SQL fundamentals learning path
Backend engineers preparing for SQL interview questions on joins, grouping, indexes, views and deadlocks.
Your progress
L1 · 0 of 6L2 · 0 of 7L3 · 0 of 6L4 · 0 of 1
Next
Level 1 · 6 questions. Begin with what gets asked in the first ten minutes. Levels 2 to 4 build on it.
Level 1First ten minutesTwo-sentence answers to what gets asked first.
Aggregation semantics
- 1.1How do GROUP BY and HAVING differ, and where does WHERE fit?Must‑knowReview againNext2 min
Cartesian products
How indexes find rows
- 3.1What happens when you search for a row without an index?Must‑knowReview againNext1 min
- 3.2What is a clustered index?Must‑knowReview againNext1 min
Lookups and covering indexes
- 4.1Why not add an index for every query?Must‑knowReview againNext1 min
Self-joins
- 5.1How do you find employees who earn more than their managers?Review againNext2 min
Level 2Daily jobWhat you use at work every week.
How indexes find rows
- 1.1What is stored in a nonclustered index?Review againNext1 min
Lookups and covering indexes
- 2.1What does INCLUDE do, and what makes an index covering?Review againNext1 min
Stored procedures and triggers
- 3.1What are stored procedures and triggers, and when do you use each?Review againNext2 min
Locking and deadlocks
- 4.1What is the difference between blocking and a deadlock?Must‑knowReview againNext2 min
- 4.2How does SQL Server detect and resolve a deadlock?Must‑knowReview againNext2 min
- 4.3How do you minimize deadlocks in SQL Server?Review againNext2 min
- 4.4What should your application do when it receives error 1205?Must‑knowReview againNext2 min
Level 3SeniorProduction trade-offs and failure modes.
Lookups and covering indexes
- 1.1What is a Key Lookup?Review againNext2 min
Locking and deadlocks
- 2.1Can a deadlock happen on a single row, and how do you prevent a conversion deadlock?Review againNext2 min
- 2.2Can a simple SELECT cause a deadlock?Review againNext3 min
PostgreSQL
- 3.1How does this differ in PostgreSQL?Review againNext1 min
- 3.2How do you find and safely drop unused PostgreSQL indexes in a live service?Review againNext2 min
PostgreSQL materialized views
- 4.1When is a materialized view useful, and how do you manage staleness?Review againNext2 min
Level 4InternalsHow it works underneath, and at scale.
How indexes find rows
- 1.1Why does a B+ tree lookup on a large table read only a few pages?Review againNext1 min
Each card is a topic. Columns go from Level 1 to Level 4; the outlined card is where you are.