Skip to content
SQLSimplified

Practice SQL Online

103 free, interactive SQL practice problems you can solve directly in your browser, no signup, no installation, no database setup.

Every problem loads its own sample database and runs your query the moment you hit execute. You get instant feedback on whether your result matches the expected output, plus a hint when you are stuck and a full worked solution when you want to check your approach. Problems are graded from easy, medium, and hard so you can build up from basic SELECT statements to window functions and CTEs.

How practicing here works

1

Read the problem

Each problem states the question in plain English and shows you the schema of the tables you are querying, so you always know what columns exist.

2

Write and run your query

Type SQL into the editor and run it against a real database running in your browser. Iterate as many times as you like, nothing is graded on attempts.

3

Check against the solution

Your result is compared to the expected output column by column. Reveal a hint if you are stuck, or the full solution to compare approaches.

What you'll practice

The problem set covers the SQL concepts that show up most often in real analytics work and in technical interviews.

  • GROUP BY32 problems
  • Joins28 problems
  • Filtering with WHERE23 problems
  • Window functions18 problems
  • Sorting with ORDER BY12 problems
  • Aggregate functions11 problems
  • COUNT10 problems
  • AVG8 problems
  • CTEs7 problems
  • SUM6 problems
  • HAVING6 problems
  • Subqueries5 problems
  • Pattern matching4 problems
  • LIMIT4 problems
  • Correlated subqueries3 problems
  • DISTINCT2 problems
  • Numeric operations2 problems
  • Ranking2 problems
  • Boolean logic1 problem

Start with these problems

Frequently asked questions

Is SQL practice on this site free?
Yes. Every practice problem, hint, and solution is free and requires no account. Queries run in your browser, so nothing is sent to a server.
Do I need to install a database to practice SQL?
No. Each problem ships with its own sample database that loads directly in your browser using DuckDB compiled to WebAssembly. There is nothing to install, configure, or connect to.
Which SQL dialect do the practice problems use?
Problems use standard ANSI SQL running on DuckDB, whose syntax closely matches PostgreSQL. Nearly everything you write here transfers directly to PostgreSQL, MySQL, SQL Server, BigQuery, and Snowflake.
How should a beginner start practicing SQL?
Start with the easy problems, which cover SELECT, WHERE, ORDER BY, and basic aggregates. Once you can solve those without hints, move to medium problems for joins and GROUP BY, then hard problems for window functions and CTEs.
Are these problems useful for SQL interviews?
Yes. The medium and hard problems cover the patterns most commonly asked in data analyst and data engineer interviews: multi-table joins, aggregation with HAVING, ranking with window functions, and CTEs.
Is my progress saved?
Your completed problems are saved in your browser's local storage, so your progress persists between visits on the same device without an account.

Prefer to learn before you practice?

If a problem introduces syntax you have not seen, work through the SQL lessons first, browse runnable query examples, or experiment freely in the SQL playground.