SQL Practice
1,500 free SQL practice problems with solutions, graded against a real Postgres warehouse with randomized seed data. Sourced from verified data engineering interview reports. 10 topic catalogs, 4 difficulty bands.
1,500 SQL practice problems with worked solutions, graded against a real Postgres 16 instance. Randomized seed data on every submission catches the lucky-fixture solutions most online SQL trainers let through. Pulled from verified data engineering interview reports.
Know the patterns before the interviewer asks them.
SQL practice topics, ranked by how often they show up in interviews
Each row opens that topic's filtered problem list. Counts update as new verified reports land in the catalog.
| Topic | Problems | Difficulty | Interview weight |
|---|---|---|---|
| GROUP BY and aggregation | 142 problems | Easy → Medium | Highest |
| Joins (INNER, LEFT, self, anti) | 168 problems | Easy → Hard | Highest |
| Window functions | 124 problems | Medium → Hard | High |
| CTEs and recursive queries | 96 problems | Medium → Hard | High |
| Subqueries and EXISTS | 88 problems | Medium → Hard | Medium |
| Date and time | 78 problems | Medium | Medium |
| CASE WHEN and conditional logic | 64 problems | Easy → Medium | Medium |
| Strings and regex | 64 problems | Easy → Medium | Medium |
| NULL handling (COALESCE, NULLIF) | 52 problems | Easy → Medium | Medium |
| Gaps and islands | 38 problems | Hard | Senior signal |
What the grader actually does
Every submission spins up a fresh Postgres database with randomized seed data inside the problem's schema. The grader runs your query against ten of those seeds. A query that hard-codes a value, depends on insertion order, or uses LIMIT without an ORDER BY tiebreaker passes one seed and fails the rest. The grader tells you which seed broke and what changed.
Top Active Senders per Channel
Top three messages per channel by replies.
Pulled from debriefs where SQL was the gate.
A four-week study plan that actually works
Built from what working candidates do, not from a course catalog. Week 3 is the one most people underweight and regret later.
| Week | Focus | Problems | Time-box per problem |
|---|---|---|---|
| Week 1 | SELECT, WHERE, GROUP BY with HAVING, INNER and LEFT JOIN | 20 Easy | 5 to 8 minutes |
| Week 2 | Multi-table joins, conditional aggregation with CASE inside SUM, date functions, the many-to-many duplication trap | 20 Medium | 10 to 15 minutes |
| Week 3 | Window functions in full: ROW_NUMBER, RANK and DENSE_RANK, LAG, LEAD, running totals, the dedup pattern. Plus CTEs and three recursive ones | 15 Medium to Hard | 12 to 20 minutes |
| Week 4 | Timed drills. Speak the solution out loud while writing it. Add gaps-and-islands and three pivots. | 10 mixed + 3 mocks | 15 Medium, 25 Hard |
5 bugs the grader catches that other tools don't
These failure modes show up in real interview rounds. The grader on this site catches them because every submission runs against ten randomized fixtures, not one reference dataset.
Common questions about SQL practice
Is SQL practice on DataDriven actually free?+
What SQL dialect should I expect?+
Can I practice SQL online without installing anything?+
How many SQL problems do I need before a real interview?+
How is this different from LeetCode SQL or HackerRank?+
Where can I find SQL problems by company?+
Start with the topic you've been avoiding
- 01
Active recall beats re-reading by 50%
Cognitive-science meta-reviews (Dunlosky et al., 2013) rank practice testing as a top-tier study technique, while re-reading and highlighting rank near the bottom
- 02
76% of hiring managers reject on the coding task, not the resume
From HackerRank's 2024 Developer Skills Report. Candidates who look strong on paper still fail the live screen if they haven't done timed, executable practice
- 03
Five problem shapes cover 80% of data engineer loops
Dedup, sessionization, top-N-per-group, slowly-changing dimensions, partition tricks. Writing the shapes by hand turns the unfamiliar into pattern recognition