unnested
Explore
Pro
Sign in
Learn SQL
CASE Expressions
Pro
25 questions
Unlock all 25 questions with a Pro subscription.
Upgrade to Pro
Output
Easy
Simple CASE (equality form)
Output
Easy
Which branch wins when ranges overlap?
Output
Easy
Salary tier from a single threshold
Multiple choice
Easy
Translating if/elif chains to SQL
Multiple choice
Easy
Where can a CASE appear in a query?
Multiple choice
Easy
No CASE branch matches - what happens?
Multiple choice
Easy
Range check: simple CASE or searched CASE?
Output
Medium
Conditional aggregation with CASE
Output
Medium
CASE with no ELSE
Output
Medium
Sorting by a priority label, not alphabetically
Output
Medium
COUNT with conditional CASE
Output
Medium
Grouping employees into salary bands on the fly
Output
Medium
Pivoting rows to columns with CASE
Multiple choice
Medium
Catching NULL - which comparison actually works?
Multiple choice
Medium
When to use CASE pivot vs PIVOT keyword
Multiple choice
Medium
Overlapping WHEN clauses - who wins?
Output
Medium
Overlapping WHEN conditions - order matters
Multiple choice
Medium
Simple CASE vs searched CASE - LIKE predicate
Output
Medium
Dynamic threshold inside WHERE
Output
Medium
CASE to avoid divide-by-zero
Output
Medium
Picking a fallback phone number
Multiple choice
Medium
COALESCE vs ISNULL portability
Output
Medium
SUM with CASE 1/0 flag pattern
Output
Hard
What happens to the NULL bonus?
Output
Hard
CASE WHEN NULL - will this branch fire?