SQL Interview Cheat Sheet¶

Joins, aggregation, subqueries, window functions and the 15 query patterns interviewers test — 59 queries, each run on a real sample database with its actual output. Free.
Price: Free
Also: Dark version (PDF)
What's included¶
- SELECT, NULL traps, GROUP BY / HAVING and CASE
- Every join type, anti- and semi-joins, subqueries and recursive CTEs
- Window functions — ROW_NUMBER, RANK, LAG/LEAD, running totals
- 15 classic interview problems with solutions and real output
- Indexes, transactions, normalisation and a MySQL/Postgres/SQL Server table
Format¶
PDF · 11 pages · light + dark