Move from recognition to independent reasoning
Practice should expose the decisions behind a solution. Start with a population and expected output, attempt the query, and use hints only when needed. Then introduce an edge case that could invalidate your answer.
Suggested route: Use the problem index for focused practice, mixed drills to hide the technique, and diagnosis drills for performance reasoning.
By the end: Explain correctness, alternatives, and a justified next investigation in a short spoken answer.
Decision reference
| Goal | Practice mode |
|---|---|
| Recall syntax | Chapter quick references |
| Recognize recurring problems | Pattern cookbook |
| Solve without a label | Mixed drills |
| Explain performance choices | Diagnosis drills |
| Collect execution evidence | Native PostgreSQL labs |
In this chapter
- Find your next SQL problemFilter questions from StrataScratch, LeetCode, and DataLemur by topic and level.
- Choose the right techniqueTranslate interview wording into candidate query patterns.
- Revision drillsWork through a deliberate sequence of query challenges.
- SQL dialect differencesTranslate common operations between PostgreSQL, BigQuery, and MySQL.
- Largest OlympicsCount distinct athletes, then keep every tied maximum.
- Apple Product CountsReduce device events to one flag per user.
- Spam PostsSee why distinct posts and view records give different percentages.
- Country rank changesRank each period separately before comparing countries.
- Top 5%: thresholds & quotasDistinguish percentile cutoffs from a fixed count of rows.
- Later purchases of new productsCompare later purchases with the complete first-day product set.
- Retention and the denominatorUnderstand why an outer join can be necessary.
- Database interview questionsPractice concise explanations of the concepts behind SQL queries.
- Practice problem indexFind a problem by technique and difficulty, then compare the worked reasoning.
- Sources, scope & coverageUnderstand what the handbook covers and where to verify dialect-specific details.
- Mixed SQL practice with progressive hintsIdentify the grain and technique without being told the pattern in advance.
- Practice: diagnose before optimizingUse symptoms and evidence to choose your next investigation, then compare the reasoning.
How to study
Use the suggested route above. For each lesson, explain the decision in your own words, test its example, and identify a situation where a different approach would be needed.