Fix data using CASE
SQL
Hard
2 views
Problem Description
In Employees, if salary is null set to 25000, if salary < 15000 set to 15000, else keep as is. Write one update statement.
Output Format
DML statement(s)
Sample Test Case
Output:
Salaries normalized
Official Solution
UPDATE Employees SET salary = CASE WHEN salary IS NULL THEN 25000 WHEN salary < 15000 THEN 15000 ELSE salary END;
Solutions (0)
No solutions submitted yet. Be the first!
No comments yet. Start the discussion!