Lesson 24 of 3275%
(Progress persistence is disabled until Phase 9)
SQL
Beginner
CASE Statement
Conditional logic in SQL.
CASE Statement
Conditional logic in SQL.
Example
-- Categorize users by age
SELECT name, CASE WHEN age >= 25 THEN 'Senior' ELSE 'Junior' END as age_group FROM users;
Test it Yourself