SQL Quest › SQL Exercises › SQL NULL Handling
SQL NULL Handling Practice — 16 Challenges (15 Free)
NULL is not a value, it is the absence of one — so it does not equal anything, not even another NULL. Almost every NULL bug in production is that one sentence, unlearned. These 16 challenges run in your browser on real tables; 15 of them are free, the best free coverage of any topic here.
Filtering on absence — why = NULL never matches: 9 challenges (8 free)
Comparing to NULL with = does not return false, it returns unknown, and WHERE keeps only rows that are true. That is why WHERE manager_id = NULL returns nothing at all rather than the rows you meant — you need IS NULL. The same rule is what makes NOT IN against a nullable column return zero rows, the trap the NOT IN trap walks through.
Counted from the challenge bank, September 2026. Easy first, then Medium, then Hard.
Easy Free
Handling NULL Values
Uses: IS NULL COALESCE
Try it →
Easy Free
Failures with No Loss Estimate
Uses: WHERE IS NULL
Try it →
Easy Free
Properties Without Listed Owner
Uses: WHERE IS NULL
Try it →
Medium Free
Genre Box Office Report
Uses: GROUP BY Aggregation NULL Handling
Try it →
Medium Free
Fare Imputation Analysis
Uses: NULL Handling COALESCE GROUP BY
Try it →
Medium Free
Senior Passengers by Port
Uses: WHERE GROUP BY Aggregation
Try it →
Medium Free
Director Rating Volatility
Uses: GROUP BY HAVING Aggregation
Try it →
Medium Free
Dormant Cards — No Transactions in the Last 14 Days
Finance & Banking track · Uses: LEFT JOIN IS NULL CTE
Try it →
Hard Pro
Anti-Join Pipeline: Unmatched Records
Uses: LEFT JOIN IS NULL CTE
Try it →
Supplying a default — COALESCE, IFNULL and NULLIF: 8 challenges (8 free)
COALESCE(col, 0) returns the first argument that is not NULL, which is how a missing number becomes a zero in a report rather than a hole in a chart. NULLIF(a, b) does the reverse and is the standard guard against divide-by-zero. The judgement is not the syntax, it is whether a default belongs there at all: a missing rating is not a rating of zero, and averaging it as one is a wrong answer that looks right.
Counted from the challenge bank, September 2026. Easy first, then Medium, then Hard.
Easy Free
Handling NULL Values
Uses: IS NULL COALESCE
Try it →
Easy Free
Default Age for Missing Records (COALESCE)
Uses: NULL Handling COALESCE
Try it →
Medium Free
Genre Box Office Report
Uses: GROUP BY Aggregation NULL Handling
Try it →
Medium Free
Fare Imputation Analysis
Uses: NULL Handling COALESCE GROUP BY
Try it →
Medium Free
LEFT JOIN NULL Semantics: Inactive Customers
Uses: LEFT JOIN COALESCE Aggregation
Try it →
Medium Free
Management Hierarchy Overview
Uses: LEFT JOIN EXISTS Subquery
Try it →
Medium Free
Handle NULL Ages
Uses: NULL Handling COALESCE Aggregation
Try it →
Medium Free
Membership Tier Revenue Analysis
Uses: LEFT JOIN GROUP BY Aggregation
Try it →
Counting what is there — the aggregates that skip NULLs: 7 challenges (6 free)
COUNT(*) counts rows; COUNT(column) counts rows where that column is not NULL, and the gap between the two numbers is the missing data. AVG, SUM and MIN ignore NULLs entirely, so an average over a half-empty column is an average of the half that exists — usually right, occasionally the bug. These are the challenges where the answer depends on knowing which.
Counted from the challenge bank, September 2026. Easy first, then Medium, then Hard.
Easy Free
Chargeback Reason Codes: Resolved and Still Open
Finance & Banking track · Uses: GROUP BY Aggregation IS NULL
Try it →
Medium Free
Genre Box Office Report
Uses: GROUP BY Aggregation NULL Handling
Try it →
Medium Free
Fare Imputation Analysis
Uses: NULL Handling COALESCE GROUP BY
Try it →
Medium Free
LEFT JOIN NULL Semantics: Inactive Customers
Uses: LEFT JOIN COALESCE Aggregation
Try it →
Medium Free
Handle NULL Ages
Uses: NULL Handling COALESCE Aggregation
Try it →
Medium Free
Membership Tier Revenue Analysis
Uses: LEFT JOIN GROUP BY Aggregation
Try it →
Hard Pro
Anti-Join Pipeline: Unmatched Records
Uses: LEFT JOIN IS NULL CTE
Try it →
Where this shows up next
NULL rarely arrives on its own. It arrives through a LEFT JOIN, which is the machine that manufactures it; it survives into an aggregate that quietly drops it; and it breaks anti-joins written with NOT IN instead of NOT EXISTS. If you want the reading rather than the practice, IS NULL vs = NULL is the short version and five NULL mistakes the long one.