Free Learning
Best Free SQL Practice Websites, Sorted by Skill Level
Where to practise SQL for free at every stage — interactive lessons for beginners, structured exercises, interview-style problems and real datasets — plus a four-week plan that takes you through them in order.
Yellow Course Editorial Team7 min read
Reading about JOIN and GROUP BY feels like progress, but SQL only sticks when you write queries, get them wrong and fix them. The good news: you can do all of that for free. The hard part is choosing where, because a beginner tutorial, an interview problem bank and a real dataset train very different skills.
This guide sorts the best free SQL practice websites by the stage you are at, then gives you a four-week plan that moves through them in order. Every site below can be used without paying; where a free tier has limits, we say so.
The best SQL practice sites at a glance
| Site | Best for | Level | Runs in the browser | Free certificate |
|---|---|---|---|---|
| SQLBolt | Your very first queries | Beginner | Yes | No |
| SQLZoo | Short drills on real tables | Beginner–intermediate | Yes | No |
| Select Star SQL | Learning by answering one real question | Beginner | Yes | No |
| PostgreSQL Exercises | Joins, aggregates and dates in PostgreSQL | Intermediate | Yes | No |
| Kaggle Learn: Intro to SQL / Advanced SQL | Querying large public datasets | Beginner–intermediate | Yes (notebooks) | Yes, certificate of completion |
| CS50's Introduction to Databases with SQL | A complete, structured course with problem sets | Beginner–intermediate | Yes (cloud workspace) | Yes, free CS50 certificate |
| LeetCode (Database problems) | Interview-style questions | Intermediate–advanced | Yes | No |
| HackerRank SQL | Graded challenges and a skills test | All levels | Yes | Yes, skill certificate tests |
| DataLemur and StrataScratch | Questions modelled on real company interviews | Intermediate–advanced | Yes | No (free tiers are limited) |
| SQL Murder Mystery | A fun break that still exercises joins | Beginner–intermediate | Yes | No |
If you only have time for one thing today, open SQLBolt and finish the first five lessons. You will have written real SELECT, WHERE and ORDER BY queries within the hour.
Stage 1: Interactive lessons for complete beginners
At the start you want instant feedback and zero setup. These sites put an editor and a table side by side, so you see the effect of every change.
SQLBolt
SQLBolt is the cleanest introduction we know: short lessons, each followed by a few exercises on the same small movie database. It covers filtering, sorting, joins, aggregates, and creating and altering tables. It will not make you fast, but it removes the fear of a blank query box. See our SQLBolt listing for what it covers and what it leaves out.
SQLZoo
SQLZoo is older and plainer, but its strength is volume. Each section — SELECT basics, SUM and COUNT, joins, subqueries — has many small questions against tables of countries, football matches and Nobel prizes. Use it after SQLBolt to repeat each idea until it feels automatic.
Select Star SQL
Select Star SQL teaches through one dataset and one story, building up to genuinely analytical questions. It is a good choice if drills bore you and you learn better when every query answers something you care about.
Stage 2: Structured exercises that build fluency
Once the syntax is familiar, the next skill is combining it: joining three tables, grouping by a date, filtering on an aggregate with HAVING. These resources are designed for exactly that.
PostgreSQL Exercises
PostgreSQL Exercises (pgexercises.com) uses one realistic schema — a country club with members, facilities and bookings — for dozens of graded questions. Because it runs real PostgreSQL, you also learn date functions, window functions and recursive queries the way they work in production. Pair it with the official PostgreSQL tutorial when you want to know why a query behaves as it does.
Kaggle Learn: Intro to SQL and Advanced SQL
Kaggle's two short SQL courses use Google BigQuery public datasets from a notebook in your browser. The questions are small, but the data is not — you query millions of rows, which teaches you to filter early and select only the columns you need. Both courses award a free certificate of completion.
CS50's Introduction to Databases with SQL
If you prefer a full course over loose exercises, Harvard's CS50 SQL is free, rigorous and project-based. Lectures cover querying, relating tables, designing schemas, writing data, views, indexes and optimisation; each week ends with problem sets that are graded automatically. Completing it through CS50's own platform earns a free CS50 certificate (a verified edX certificate is the paid option).
Stage 3: Interview-style SQL problems
Data analyst and data engineer interviews usually include a timed SQL exercise. The questions follow recognisable patterns: top N per group, running totals, retention, deduplication, and gaps between events. Practise those patterns on purpose.
- LeetCode has a dedicated Database problem set and a curated "SQL 50" study plan. Many questions are free; some are reserved for paid members.
- HackerRank groups challenges by topic and difficulty and offers free skill certification tests in SQL (Basic, Intermediate and Advanced). A passed test is a modest but concrete signal on a CV.
- DataLemur and StrataScratch collect questions modelled on real company interviews and explain the expected solution. Their free tiers are generous enough for regular practice; full access is paid.
Tip: after solving an interview question, rewrite it a second way — for example, a window function instead of a self-join. Interviewers often ask "how else could you do this?"
Stage 4: Practise on real, messy data
Practice sites give you tidy tables and a single right answer. Real work does not. Before you apply for jobs, spend time with data nobody has cleaned for you.
- Install PostgreSQL or SQLite locally and import a public dataset (city open-data portals, government statistics, or Kaggle datasets). Write the questions yourself, then answer them.
- Use the BigQuery sandbox, which lets you query Google's public datasets without a credit card, within monthly free limits.
- Write up one analysis as a short README with your queries, the answer and one chart. This becomes a portfolio piece — see our data analyst roadmap for project ideas.
A four-week SQL practice plan
About 30–45 minutes a day is enough. The point is to write queries every day, not to finish quickly.
| Week | Focus | Where to practise | You are ready to move on when… |
|---|---|---|---|
| 1 | SELECT, WHERE, ORDER BY, LIMIT, basic joins | SQLBolt, then SQLZoo | You can answer a two-table question without looking up syntax |
| 2 | GROUP BY, HAVING, aggregates, outer joins, subqueries | SQLZoo, PostgreSQL Exercises | You know when a LEFT JOIN changes your row count, and why |
| 3 | Window functions, CTEs, dates, CASE | PostgreSQL Exercises, Kaggle Advanced SQL | You can rank rows within groups and compute a running total |
| 4 | Timed interview problems and one real-data project | LeetCode or HackerRank, plus your own dataset | You solve most medium questions in under 20 minutes |
Common mistakes when practising SQL
- Only doing beginner lessons. Finishing three beginner tutorials teaches less than one week of harder exercises. Move on as soon as the basics feel easy.
- Ignoring NULLs. Many wrong answers come from
NULLin a join or aCOUNT(column)versusCOUNT(*). Check row counts after every join. - Not reading the error message. Database errors are usually precise. Read the whole message before changing anything.
- Memorising solutions. If you looked at a solution, close it and solve the problem again from scratch the next day.
When a full SQL course is worth it
Free practice sites are enough to learn SQL. A structured course helps when you want a guided path, video explanations or broader database design. Good options in our catalog include:
- CS50's Introduction to Databases with SQL — free and the most thorough.
- The Complete SQL Bootcamp by Jose Portilla — a popular paid PostgreSQL course for beginners.
- SQL and PostgreSQL: The Complete Developer's Guide by Stephen Grider — for developers who will design schemas, not just query them.
- Databases and SQL for Data Science with Python from IBM — SQL combined with Python notebooks.
Browse every option, filtered by price and level, in our SQL courses and PostgreSQL courses collections. If you are learning SQL for analytics, continue with data analysis, Power BI or Tableau.
Frequently asked questions
Where can I practise SQL for free?
SQLBolt and SQLZoo for beginners, PostgreSQL Exercises and Kaggle Learn for intermediate practice, and LeetCode or HackerRank for interview-style problems. All of them run in the browser with nothing to install.
How long does it take to learn SQL?
Most people can write useful queries after two to four weeks of daily practice. Becoming comfortable with window functions, query performance and messy real-world data takes a few months of regular use.
Which SQL dialect should I practise?
Start with standard SQL as taught on SQLBolt or SQLZoo; the core is the same everywhere. If you must pick one database, PostgreSQL is free, widely used and close to the standard. Learn the differences of MySQL, SQL Server or BigQuery when a job requires them.
Can I get a free SQL certificate?
Yes. Kaggle Learn's SQL courses, HackerRank's SQL skill tests and Harvard's CS50 SQL (through CS50's own platform) all offer free certificates. Employers value demonstrated skill more than any certificate, so pair it with a project you can show.