What interviews actually test
Most SQL rounds come back to the same handful of patterns: aggregation with GROUP BY and HAVING, joins (especially finding rows with no match), window functions like ROW_NUMBER and running totals, dates and cohorts, and deduplication.
The five patterns to master
- Group and filter: totals per group, then HAVING to keep only groups that pass a test.
- Anti joins: LEFT JOIN where the right side is null, to find customers who never ordered.
- Top N per group: ROW_NUMBER over a partition, then keep row 1.
- Running totals: SUM over an ordered window.
- Cohorts: group users by signup month and track what they did later.
Practice on real looking data
Clean textbook tables hide the hard part. Real data has duplicates, nulls and dates stored in odd formats. Every Crossway Arena SQL problem runs against real tables in your browser and checks your result row by row.
A two week plan
- Days 1 to 4: two aggregation and join problems a day.
- Days 5 to 9: window functions, one Medium and one Hard a day.
- Days 10 to 14: timed mixed sets, and explain each answer in two lines.