Complete the code to return 'High' when score is 90, else 'Other'.
SELECT CASE score WHEN [1] THEN 'High' ELSE 'Other' END AS grade FROM exams;
The CASE expression compares score to 90 and returns 'High' if it matches.
Complete the code to return 'Pass' when status is 'P', else 'Fail'.
SELECT CASE status WHEN [1] THEN 'Pass' ELSE 'Fail' END AS result FROM tests;
The CASE checks if status equals 'P' to return 'Pass'.
Fix the error in the CASE expression to return 'Adult' when age is 18.
SELECT CASE age WHEN [1] THEN 'Adult' ELSE 'Minor' END AS category FROM people;
Since age is a number, WHEN should compare to 18 without quotes.
Fill both blanks to return 'Low', 'Medium', or 'High' based on score.
SELECT CASE score WHEN [1] THEN 'Low' WHEN [2] THEN 'High' ELSE 'Medium' END AS level FROM results;
Score 25 returns 'Low', 100 returns 'High', others 'Medium'.
Fill all three blanks to return 'Red', 'Green', or 'Blue' based on color_code.
SELECT CASE color_code WHEN [1] THEN 'Red' WHEN [2] THEN 'Green' WHEN [3] THEN 'Blue' ELSE 'Unknown' END AS color_name FROM palette;
Color codes 1, 2, 3 correspond to Red, Green, Blue respectively.
