Start with what you're practicing for
People mean three different things by "practice SQL", and the right site depends on which one you mean.
- Learning the language. You want short lessons, an editor next to each one, and fast feedback. Any of the free beginner sites will do.
- Getting fluent. You know SELECT, JOIN and GROUP BY, and you want harder queries on data you haven't seen before.
- Passing an interview. You need the question types that come up again and again (top N per group, running totals, gaps, duplicates), practiced until you can explain your answer out loud.
Most people go through all three in that order. The table above sorts each option by the job it does well. Here's the same list grouped by stage.
If you're starting from zero
SQLBolt is the quickest way in. Each lesson is a short explanation and a few exercises that run in the browser, and there's no account to create. It covers SELECT, filtering, joins, aggregates and basic table changes, then stops. That's fine: it's a first pass, not a full course.
SQLZoo goes a bit further. Its tutorials start at SELECT basics and keep going through subqueries, joins, NULL handling and window functions, all on public datasets like world countries and Nobel prize winners. The data is interesting to query, but the questions read like textbook exercises rather than interview prompts.
W3Schools is the place most people already have open when they look up syntax. Its SQL exercises are multiple choice and fill in the blanks, so they check that you remember the keyword. They don't ask you to write a whole query, which is what you'll be doing at work.
If you want harder queries
PostgreSQL Exercises runs on real PostgreSQL and moves from simple selects through joins, aggregates, dates, strings, window functions and recursive queries. Every question uses the same small dataset, so after a few sections you know the tables well and can focus on the query itself. If your job uses Postgres, this is good practice for its date functions and syntax.
If you're preparing for an interview
This is where the options differ most, so look at what each one is built around.
DataLemur is focused on SQL interview questions for data analyst and data science roles. The site has a free SQL tutorial for data analytics, and its pricing page puts the full question set, with hints and full solutions, in a Premium plan.
StrataScratch covers data science interviews more broadly. SQL sits next to Python, with questions for data science, machine learning and AI engineering roles. It has free SQL learning paths if you want structure before the interview questions, you can start without a credit card, and a separate pricing page covers the paid parts.
HackerRank is mostly a hiring platform for companies, but it keeps a SQL practice area for developers. Challenges are tagged by skill (Basic, Intermediate, Advanced) and grouped into subdomains such as Basic Select, Aggregation and Advanced Join. Sign up is free.
Query Dojo is our site, so weigh this paragraph with that in mind. Practice questions on querydojo.com run on real sample databases in your browser, with no signup and no account. Every answer is checked against the expected result. Easy questions and the web-only practice pages are free on the web; premium questions show the problem but lock the hints and solution, which come with a subscription in the iPhone app. It runs SQLite only, so it isn't the place to drill a specific engine.
A simple four-week plan
You don't need every site on this list. Pick one per stage and stay with it.
- Week 1: basics. Work through SQLBolt or the first SQLZoo tutorials. Aim to write SELECT, WHERE, ORDER BY, JOIN and GROUP BY without looking anything up.
- Week 2: aggregation and filtering. Practice GROUP BY with HAVING until you can say why a filter goes in one clause and not the other. Our WHERE vs HAVING question is a good check.
- Week 3: window functions. Many interview questions that feel hard are window functions in disguise. Work through ranking, running totals and LAG, starting with the window functions questions, and do Nth Highest Salary three different ways.
- Week 4: timed practice. Pick questions you haven't seen, give yourself a time limit, and say your approach out loud before you type. That last part is the skill most people skip.
Habits that matter more than the site
- Write the query before you look at hints. A wrong attempt teaches you more than a solution you read.
- Check edge cases on purpose. Ties, NULLs and empty groups are where interview answers break. Ask yourself what your query does when two rows share the top value.
- Redo old questions. Coming back to a question a week later, without notes, tells you whether you learned the pattern or just remembered the answer.
- Learn one dialect well. Interviews usually let you pick. The differences between SQLite, PostgreSQL, MySQL and SQL Server matter less than knowing joins, grouping and window functions cold.