Role Pack · Mid
SQL Mastery Pack
Advanced SQL: window functions, CTEs, query tuning, transactions and modelling.
SQL beyond the basics: advanced queries, execution plans, transactions and schema design.
- Questions
- 360
- Topics
- 20
- Pages
- 237pages
- 360 questions, every one with a model answer
- Advanced query patterns
- EXPLAIN & tuning
- Transactions & isolation
- Schema design
Get the SQL Mastery Pack — $9
One-off. Delivered as a PDF by email the moment payment clears.
Prices shown are a USD base. Your local-market price is calculated at checkout in your own currency, plus any local sales tax.
What is inside
20 chapters, in the order the interviews tend to ask them:
- Relational modelling, entities and cardinality
- Primary keys, foreign keys and constraints
- Normalisation and deliberate denormalisation
- Join types, join order and outer join pitfalls
- Anti joins, existence checks and set operations
- Subqueries, derived tables and common table expressions
- Window functions, frames and ranking
- Aggregation, grouping and conditional summaries
- Recursive queries and hierarchical data
- Index types, column order and the cost of writes
- Reading execution plans and estimating cost
- Transaction boundaries, commit and rollback
- Isolation levels and the anomalies they permit
- Row locks, table locks and lock granularity
- Deadlocks, detection and safe retries
- Pagination, keyset paging and cursors
- JSON columns, functions and the modelling trade-off
- Schema migration, rollouts and reversibility
- Three valued logic, nulls and SQL comparison traps
- Views, materialised views and derived data
How the answers are built
Each chapter opens with the checklist the question is really testing. A few from this pack:
- Grain is the most useful sentence in a schema review: one row per what, and almost everything else follows from it.
- A surrogate key insulates you from a business rule that changes, and a natural key only works if that rule genuinely never changes.
- First normal form is about atomic values, so a comma separated list column is the smell to look for.
- An inner join returns matching pairs and an outer join preserves one side, which is why the outer join loses its meaning after a filter in where.
- not in against a subquery whose column can be null returns no rows at all, which is the most dangerous null trap in SQL.
- A correlated subquery references the outer row, so it re-executes per row unless the planner can decorrelate it into a join.
Questions this pack covers
- Walk me through how you would turn a stated business requirement into a set of relations.
- What does a cardinality ratio actually tell you about how to lay out tables?
- Why is a surrogate primary key safer than a natural one?
- What does a random uuid key actually cost on a large table?
- What does each normal form actually prevent?
- Why does a transitive dependency break third normal form?
- What is the difference between an inner and a left outer join?
- Why does a full outer join rarely turn up in application queries?
Each one is answered in full in the pack, with the reasoning written out rather than a bullet list.
About this pack
- How many questions?
- 360, spread across 20 topics, written out in full across 237 pages.
- Do the answers just list keywords?
- No. Each answer is written as prose, because that is what you have to reproduce when someone asks you the question.
- How do I get it?
- Pay once and the PDF arrives by email immediately, with a signed download link.
- Can I get it refunded?
- Yes, if it is not what you expected. See the refund policy.