unnested
Pro

© 2026 unnested

Built for learners, by learners

AboutPrivacy PolicyTerms of ServiceContactSuggest a feature
Learn SQL

CASE Expressions

Pro

25 questions

Unlock all 25 questions with a Pro subscription.

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