SQL problem - Swap Salary
Problem
Solution
To dynamically set a value to a column, we can use UPDATE
statement together when CASE
…WHEN
… flow control statement.
UPDATE salary
SET
sex = CASE sex
WHEN 'm' THEN 'f'
ELSE 'm'
END;