We're sorry but this app doesn't work properly without JavaScript enabled. Please enable it to continue.

11 Best Sites to Practice SQL Online in 2026 (Free and Paid)

Maya Chen
Maya ChenComputer science and programming educator at Boot.dev

Last published

Table of Contents

You can read about SQL JOINs for a week and still freeze when an interviewer gives you three table definitions and a question about 'em. SQL is a skill learned by typing. The only way to get good is to actually write a few hundred queries against some real data and see what comes back.

Prices and problem counts below were verified September 2026, links included, and I noted which database engine each one runs. To be fair, the SELECT you learn on SQLite is the same SELECT on Postgres, but there are quite a few differences in other syntax features and how stuff works under the hood.

Site Price Account needed Problems Engine
Boot.dev Learn SQL and playground Free to start, then $59/mo or $399/yr Free account for the course 66 graded coding lessons SQLite (server)
SQLBolt Free No 18 lessons with graded tasks SQLite (browser)
PostgreSQL Exercises Free No 71 in 7 categories PostgreSQL
SQLZoo Free No 12+ tutorials, 9 quizzes MySQL
DataLemur Free tier, $15/mo, $60/yr, $300 lifetime No, to run 100, 45 locked PostgreSQL 14 or MySQL
LeetCode SQL 50 Free plan, Premium extra Yes 50 MySQL, PostgreSQL, others
HackerRank SQL Free Yes 58 MySQL, T-SQL, Oracle, DB2
StrataScratch Free tier, $19/mo, $97.30/yr, $202.30 lifetime Yes, to run 1,000+ across SQL, Python, R PostgreSQL, MySQL, others
sql-practice.com Free, ad-supported No 69 SQLite (browser)
SQL Murder Mystery Free No 1 (a good one) SQLite (browser)
Codewars SQL Free Yes 395 kata PostgreSQL 9.6/13, SQLite

How I ranked these

I used 3 criteria, in this order:

  1. Does it check your query? A site that runs your SQL and tells you if the result is right is good practice. A site that presents a query and a "Show Answer" button is more like a blog post.
  2. How fast can you start? No install, no account, and no card gets you going faster, which means you're less likely to give up before you write a few statements.
  3. Who is it for? A beginner learning WHERE for the first time, an analyst prepping for a window-function interview, and a backend developer who wants to prep for schema design interviews need different kinds of practice.

Boot.dev: Practice with a course attached

Look, Learn SQL by Boot.dev is our course, and it's on this list because 66 of its 95 lessons are graded coding exercises. You write the query yourself, the checker runs it against the database, you either pass or you don't. It's 30 hours across 11 chapters, rated 4.8 from 2,179 reviews with 55,015 students as of September 2026. But the course actually isn't the reason it's on this list. It's on this list because we make money when you buy it because it also has a practice section of the site where you can drill one-off challenges on SQL topics of your choosing.

The Training Grounds is the tab on Boot.dev where you can practice all sorts of SQL challenges in the same in-browser environment, but where you're not constrained by the smaller set of problems in the course. You can pick a topic, pick a difficulty, and get a problem to solve based on your practice needs.

There's also the free SQL playground: SQLite running on our server, no account, no install. Each run starts from a clean database and executes your whole script, so you paste in a CREATE TABLE, a few INSERTs, and the query you're testing, and see the result set. Especially nice if you just want an online sandbox to play in without needing to log in.

The cons:

  • Most of the graded lessons need a membership. The first chapters are free with full interactivity and every lesson is free to read. After that, it's $59/month or $399/year with a 30-day refund.
  • It's SQLite. The course flags each place SQLite behaves differently (booleans are integers, some Postgres functions don't exist), and the data-analyst path moves on to Pandas and Power BI a few courses later, but if you want Postgres, you'll need to check out the Backend Path or one of the other sites below.

Here's a review of the Boot.dev option from an independent Redditor:

Boot.dev has a lot of courses, but among them is a course on SQL that teaches you the beginner basics without requiring to install anything locally.

Best value for money if you wanna learn other stuff as well in an already lesson ready format that's interactive and requires you to write code to move to the next lesson. But otherwise just buy a month and do the SQL course.

My 1 year sub is almost up but I learnt a shit ton on there.

-- MisterElementary

SQLBolt: very free and open

SQLBolt is 18 lessons, each a short explanation followed by tasks you have to solve before the next lesson unlocks. It runs SQLite in your browser, there's no login (there isn't even a login page), and if you're stuck, every task has a "read this task's solution" link. If you've never written a query before, an afternoon here will ftfy.

The cons:

  • It stops at intermediate. No window functions, no CTEs, nothing you'd call advanced. When you finish, you know SELECT, JOIN, GROUP BY, and how to insert and update rows. No advanced theory explanations or practice here.
  • The copyright says 2024 and the lessons haven't changed in years... to be fair SQL hasn't changed all that much either, so it matters less than it would with a language like Go.

PostgreSQL Exercises: the best free option for real Postgres

PostgreSQL Exercises is one dataset (a country club with members, facilities, and bookings) and seven categories of questions that range from SELECT * up to window functions, recursive queries, and date manipulation. Each question has a "Run Query" button that checks your result, a "Hint" button, and an "Answers and Discussion" section you can toggle open right there. It's free, no account is required, and importantly it's actual PostgreSQL (my favorite SQL DB).

This is the site I'd point an analyst at before an interview that mentions LEAD, ROW_NUMBER, or DENSE_RANK, because those questions are here and the explanations are quite good.

The cons:

  • Every question uses the same country-club dataset. After all 71 of them you know it very well.
  • No accounts. Your progress lives in your browser's local storage, so clear your site data and it's gone. You can always use your own local database to store your progress I suppose...
  • The UI is old. Sometimes that's cool though.

SQLZoo

SQLZoo is the other old and free legend, maintained by Andrew Cumming, who first built it at Edinburgh Napier University before most practice sites existed, and still updated (the wiki says July 2026). It's a dozen numbered tutorials on a MySQL backend, from basic SELECT through joins, aggregates, and some window functions, plus quizzes and 15-question assessments.

The cons:

  • It's a wiki, and it kinda looks like one. Navigation was confusing to me my first time, and some questions are worded in a way that makes me question my own understanding of my native language.
  • Answers are deliberately withheld for many tutorials. That's a pedagogical choice, and it's also why you'll see so many SQLZoo answer repos strewn about GitHub.

DataLemur: interview questions, free tier, real Postgres

DataLemur is Nick Singh's practice site (he wrote Ace the Data Science Interview), built around questions that real companies asked in data analyst and data science interviews. You pick PostgreSQL 14 or MySQL, run your query, and check it against the expected output. Every question has a hint and a full written solution.

Pricing on the page is $15/month, $60/year, or $300 one-time for lifetime access, a signed copy of his book, and an hour of coaching with him.

The cons:

  • 45 of the 100 SQL questions are locked behind Premium. At least they're badged in the list, so you know before you click.
  • It's analyst-flavored. Great for a data role, less useful if you're preparing for a backend job where the SQL questions are about schema design and architecture.

LeetCode SQL 50

The SQL 50 study plan is a great drill for software engineers before an interview with a SQL round. It has 50 problems (obvi): 32 easy, 17 medium, and one hard, with MySQL, PostgreSQL, SQL Server, and Oracle all available.

The cons:

  • SQL is a side track on a platform built for algorithms. The free editorials are often a bit bare, and some of the best ones sit behind Premium payment options.
  • Premium is priced for the whole platform. You're paying for algorithms content to get to the SQL stuff.

HackerRank SQL

HackerRank's SQL domain has 58 problems (38 easy, 18 medium, 2 hard) and is free! HackerRank also gives away SQL skills certifications. The Basic one is a 30-minute, two-question test. I covered them in our SQL certifications guide.

The cons:

  • 58 problems, mostly easy. You'll run out very quickly. That's fewer problems than Boot.dev's SQL course has graded lessons.
  • Some problems are badly worded, especially the older ones. Though that complaint about HackerRank SQL predates most of the sites on this list, so maybe it's gotten better?
  • Account required before you can run anything.

StrataScratch: the big paid bank

StrataScratch has over a thousand questions across SQL, Python, and R, with hints and solutions. The free tier gives you a limited set and 50 AI credits a month. Paid is $19/month, $97.30/year (30% off a $139 list), or $202.30 for lifetime (off $289). StrataScratch is a cult favorite online as far as I can tell, a lot of great comments on Reddit about it. I like that it doesn't skip the hard stuff:

Stratascratch however, is seriously difficult, either I am not good at SQL enough or I lack the intellect to solve these questions.

-- Consistent_Draft4272 on Reddit

The cons:

  • Most of the bank is paid, and you need an account to run anything, even the free questions.
  • Slow loading, reportedly. DataLemur's comparison page says the question list sometimes doesn't load. That's a competitor talking, so weigh it accordingly.
  • The yearly and lifetime prices are a promo. The banner says 30% off is applied automatically, so the $139 and $289 list prices could come back any day.

sql-practice.com

sql-practice.com is a small, clean site with 69 problems across two datasets (a hospital and Northwind), split into easy, medium, and hard, running SQLite in the browser. Your query is validated every time you run it, so you get an immediate yes or no. No account required.

The cons:

  • Ad scripts load on every page. Very annoying, but it's how it pays for itself.
  • Small bank of questions, and SQLite only. Good for a day or two of practice, but not if you're trying to get really good.

SQL Murder Mystery

SQL Murder Mystery from Northwestern's Knight Lab is one of the most creative options in my list: there's been a murder in SQL City, and you have a police database. You write queries to find the killer. It's free, in the browser, and if you've never written SQL there's a walkthrough. It's also the one thing on this list I'd recommend to a friend who isn't sure SQL is for them, because every query has a fun reason to exist. It answers the age-old question of "when would I use this in the real world?"

The cons:

  • One mystery. Again, once you're done you're done.
  • Nothing new since 2019. A typo fix here and there, but the mystery is the same. It doesn't really need updating, but good to know.

Codewars SQL

Codewars has 395 community-written SQL kata, ranked from 8 kyu (easy) up to 2 kyu, on PostgreSQL 9.6, PostgreSQL 13, or SQLite. You solve it, then you see everyone else's solutions, which is my favorite part of that platform. Free with an account.

The cons:

  • Uneven quality. Community kata range from super awesome to actually broken at times.
  • The tests are written in RSpec. When you fail, you read Ruby test output to find out why, which is a strange experience if you're just there for SQL.
  • Postgres 13 is a few versions behind.

Also worth knowing about

  • Select Star SQL is a free, ad-free interactive book (four chapters plus a set of challenge questions) aimed at absolute beginners, about 30 minutes a chapter, running SQLite in the browser. The dataset is Texas death-row records, which is... grim. Trigger warning, I guess?
  • W3Schools SQL exercises are 300 fill-in-the-blank and multiple-choice exercises across 60 topics. Fine for checking you remember the keywords, but you never write a query from scratch, so I don't really count it as practice.
  • DB Fiddle and SQL Fiddle aren't practice sites, they're online sandboxes. No problems, no checking, but DB Fiddle lets you run the same query on MySQL, MariaDB, PostgreSQL, or SQLite (pick the engine and version from a dropdown), which is a cool way to learn what "dialect differences" are.

When to stop practicing

The most common advice on r/SQL, once someone has done a few dozen problems, is to stop doing canned problems and load some real data. Docker plus Postgres, DuckDB in a terminal, a Kaggle dataset, BigQuery's public datasets, anything with a few hundred thousand rows. And you shouldn't just be querying datasets, but creating them and using them in larger projects. Especially if you're going to work as anything other than an analyst. Think backend dev, data scientist, or data engineer.

Drill sites teach syntax and query patterns, but they can't teach you what to do when the data is wrong, the schema is that-guy-who-quit-in-2014's mistake, or you've got a hairy migration to perform in production. You learn that by building stuff from scratch. It's why our SQL course sits inside a full, structured backend path where the next thing you do with your SQL is wire it up in a web server.

Anyways, go slam ~100 problems, and then go build something.

Frequently Asked Questions

Where can I practice SQL for free?

SQLBolt, PostgreSQL Exercises, SQLZoo, SQL Murder Mystery, and sql-practice.com are free and run in the browser with no install. SQLBolt and pgexercises don't even need an account. Boot.dev's SQL playground is free without an account, and the first chapters of its SQL course are free with graded exercises. HackerRank's SQL track is free, and so is LeetCode's SQL 50 study plan on the free plan.

What is the best website to practice SQL for interviews?

DataLemur and StrataScratch are built around real data analyst and data science interview questions from named companies, and DataLemur lets you pick PostgreSQL 14 or MySQL. LeetCode's SQL 50 is the standard drill for software engineering interviews. PostgreSQL Exercises is the best free option for the window functions and recursive queries that trip people up in analyst interviews.

Is SQL practice enough to learn SQL?

Practice sites are good at drilling syntax and query patterns, and bad at teaching you to design tables, which is most of the job. Pair a drill site with a course that makes you build a schema, then load a real dataset into Postgres or DuckDB and answer your own questions about it. That last step is where most people on r/SQL say the learning actually happened.

Which SQL dialect should I practice in?

Practice in the one your target job uses. PostgreSQL is the safest default for backend and analytics work, and pgexercises, DataLemur, and Codewars all run it. SQLite sites like SQLBolt and sql-practice.com are fine for learning the core language, since SELECT, JOIN, and GROUP BY work the same everywhere. The differences show up in date functions, string functions, and window functions.

How many SQL practice problems should I do?

Enough that you stop thinking about syntax. For most people that's somewhere between 50 and 100 problems across joins, aggregations, subqueries, and window functions. After that, more drills have diminishing returns, and a real project with messy data teaches you more per hour than problem number 150.