SQL practice sites fall into two groups. Tutorials such as SQLBolt and W3Schools teach the language one statement at a time. Question banks such as StrataScratch, DataLemur and LeetCode give you interview-style problems and expect you to know the basics. The Work Gym sits between them: a course that teaches each skill and then makes you use it, with interview practice at the end.
At a glance
| Best for | Free | Paid | |
|---|---|---|---|
| SQLBolt | A first pass through SQL | Every lesson; the site mentions no paid plan | None listed |
| W3Schools | Looking up syntax and trying it | The tutorial, its editor, exercises and a quiz, with no account | A SQL certificate and a PLUS plan; the SQL page gives no prices |
| DataLemur | Interview questions tagged by company | A free SQL tutorial and the questions not marked Premium | $15 a month, $60 a year, or $300 once with a coaching call and a signed book |
| StrataScratch | A large bank of interview questions | 75+ questions with solutions, in SQL and Python | $24 a month, $139 a year, or $289 once |
| LeetCode | SQL next to coding problems | The SQL 50 study plan | Premium, which includes Advanced SQL 50: $35 a month, or $159 a year |
| The Work Gym | Learning SQL properly, then interviewing | The first unit of the SQL course, seven lessons, with no account | One Course: $17.99 a month or $54.99 a year. All Access: $29.99 a month or $139.99 a year |
SQLBolt
SQLBolt calls itself “Learn SQL with simple, interactive exercises.” It runs through SELECT, filtering, joins, NULLs, aggregates, and creating and changing tables, then adds pages on subqueries and set operations. You type each answer in the browser. It’s short and clear, and it’s where many people should start.
W3Schools
W3Schools is the reference most people land on from a search. Its SQL tutorial explains each statement with a “Try it Yourself” editor, ends many chapters with an exercise, and has a quiz. You can study without an account. W3Schools also offers a SQL certificate.
DataLemur
DataLemur is built around real interview questions, tagged with companies such as Microsoft, Amazon and JPMorgan. Paid plans include more than 100 SQL questions with hints and full solutions, plus more than 70 data science questions. At $60 a year it costs about the same as our One Course plan.
StrataScratch
StrataScratch has the largest question bank here: more than 1,000 coding questions in SQL, Python and R on its paid plans, plus 500+ questions on machine learning, statistics and system design, and more than 50 data projects. Its free plan has more than 75 questions with solutions. The lifetime plan costs $289.
LeetCode
LeetCode is a large site of coding problems, and it has two SQL study plans: SQL 50, and Advanced SQL 50, “50 high-frequency SQL questions” meant for about a month of prep, which is part of Premium. Premium is $35 a month, or $159 a year on yearly billing.
Their strengths
The question banks have far more interview questions than we do, and they tag them by company. If your interview is next week and you already know SQL, DataLemur or StrataScratch will give you more questions to drill.
SQLBolt and W3Schools cost nothing.
Our free part is the first unit of the course; after that you need a plan.
Our approach
Our SQL course has 97 lessons in four levels, from WHERE and ORDER BY to joins, window functions, database design, safe updates, query performance and dialects. Every exercise is checked when you run it, and the checker also runs your query on a hidden copy of the data. A wrong answer gets a message about the likely mistake, not just “incorrect”.
Each level ends in projects and case studies, such as building a KPI pack for a leadership meeting, then interview question sets and a timed mock exam. In the Interview Hub you can talk through a SQL problem out loud with an interviewer who asks follow-up questions.
SQL in other tools is covered too: Snowflake, BigQuery, Databricks and dbt each have their own simulator. For projects that use SQL next to Excel or Power BI, see SQL projects.