Complete the code to return 'Adult' if age is 18 or more, else 'Minor'.
SELECT name, CASE WHEN age >= [1] THEN 'Adult' ELSE 'Minor' END AS status FROM people;
The CASE expression checks if age is 18 or more to classify as 'Adult'.
Complete the code to assign 'Pass' if score is 50 or more, otherwise 'Fail'.
SELECT student, CASE WHEN score >= [1] THEN 'Pass' ELSE 'Fail' END AS result FROM exams;
The passing score is 50, so the CASE expression uses 50 to decide.
Fix the error in the CASE expression to categorize salary as 'High' if above 70000, else 'Low'.
SELECT employee, CASE WHEN salary [1] 70000 THEN 'High' ELSE 'Low' END AS category FROM staff;
To classify salary as 'High' when it is above 70000, use '>' operator.
Fill both blanks to classify temperature as 'Cold' if below 15, 'Warm' if between 15 and 25, else 'Hot'.
SELECT city, CASE WHEN temp < [1] THEN 'Cold' WHEN temp <= [2] THEN 'Warm' ELSE 'Hot' END AS weather FROM forecast;
Temperature below 15 is 'Cold', up to 25 is 'Warm', else 'Hot'.
Fill all three blanks to assign grade: 'A' if score >= 90, 'B' if >= 75, else 'C'.
SELECT student, CASE WHEN score >= [1] THEN 'A' WHEN score >= [2] THEN 'B' ELSE [3] END AS grade FROM results;
Grades are assigned based on score thresholds: 90 for A, 75 for B, else C.