How to use this roadmap
- This is a SQL coding interview roadmap, not a system design or database design one — there's no schema design, no storage-engine internals, and no B-tree implementation details. Just query-writing fluency and the theory that supports it.
- Go through topics top to bottom — Window Functions and Recursive CTEs assume the join, aggregation, and subquery fluency built up in the earlier topics.
- Most problems are free LeetCode Database questions; a handful of premium LeetCode problems and one PostgreSQL Exercises problem are marked accordingly where they teach something the free set doesn't.
- This is an independent track in the interview prep collection: its own progress, its own “come back later” list, and no interview countdown.
The Roadmap
- 1
The query skeleton you'll type in some form in almost every other subtopic on this roadmap — and the NULL-comparison trap that catches candidates who've never had it explained properly.
- 2
Almost no interesting business question lives in a single table — this is where SQL interviews actually start.
- 3
Turning many rows into one summary row per group — the mechanism behind almost every "count/sum/average X per Y" interview question.
- 4
Answering a question about a group's own aggregate — "who's above average," "who's the top earner per department" — needs a query nested inside a query, one way or another.
- 5
The single highest-leverage topic in this roadmap for a senior-level SQL interview: compute a rank, a running total, or a per-group comparison without collapsing the rows that produced it.
- 6
The handful of verbal, conceptual questions a database-focused interview loop tends to mix in alongside the query-writing — kept deliberately shallow, since this roadmap is about passing a coding interview, not a systems design one.