Complete the code to return 'Adult' if age is 18 or more, otherwise '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 categorize scores: 90 or above as 'Excellent', else 'Good'.
SELECT student, CASE WHEN score >= [1] THEN 'Excellent' ELSE 'Good' END AS grade FROM results;
The CASE expression uses 90 as the threshold for 'Excellent'.
Fix the error in the CASE expression to correctly assign 'Pass' if marks are 50 or more, else 'Fail'.
SELECT student, CASE WHEN marks [1] 50 THEN 'Pass' ELSE 'Fail' END AS result FROM exams;
The '>=' operator includes 50 marks as passing.
Fill both blanks to classify temperature: 'Hot' if temp > 30, 'Warm' if temp > 20, else 'Cold'.
SELECT city, CASE WHEN temperature [1] 30 THEN 'Hot' WHEN temperature [2] 20 THEN 'Warm' ELSE 'Cold' END AS weather FROM forecast;
Use '>' to check if temperature is greater than 30 for 'Hot' and greater than 20 for 'Warm'.
Fill all three blanks to create a CASE expression that returns 'A' for score >= 90, 'B' for score >= 80, else 'C'.
SELECT student, CASE WHEN score [1] 90 THEN 'A' WHEN score [2] 80 THEN 'B' ELSE [3] END AS grade FROM tests;
The CASE uses '>=' to include boundary scores and returns 'C' as the else result.