Skip to content
Interview prep

SQL Interview Practice

Practice the SQL questions that show up in analyst interviews: joins, aggregates, grouped reports, CASE logic, date ranges, window functions, CTEs, subqueries, ranking, running totals, and the debugging steps that separate a working answer from a lucky one.

These pages are built around interview prompts, not syntax memorization. Each topic shows what the interviewer is testing, how to structure an answer, and which SQLShed lessons or playground missions let you practice the same pattern against real tables.

Use them after the main learning path or as a focused review before a screen. For every question, say the grain of the result first, name the table relationships, then write the query in small steps so mistakes are easy to catch.

Answer the business question

Most SQL interview prompts are short, but the expected answer includes assumptions: what counts as a customer, whether unmatched rows stay, and how ties or duplicate rows should be handled.

Explain the result grain

Before typing, state whether the result is one row per customer, order, category, channel, or event. That single sentence prevents many join and GROUP BY mistakes.

Verify with small checks

Good candidates debug as they go: count source rows, inspect join matches, compare grouped totals, and test tie cases before treating an answer as final.