412 SQL practice problems · free to start
Can you solve it?
Learn SQL by solving real business problems — from your first SELECT to interview-level window functions. Right in your browser.
- 3 real datasets
- Instant feedback
- XP, levels & streaks
QUESTION Which 3 products are the most expensive? Edit the query and hit Run.
- 412
- SQL problems
- 9
- chapters, easy → hard
- 3
- real-world datasets
- $0
- to start, no card
What you'll learn
Nine chapters. One skill employers ask for.
Every chapter starts easy and ends hard. Play 10 new problems free every week, or go unlimited with Pro.
- 01SELECT BasicsPull columns out of a table, remove duplicates with DISTINCT, and sort the result.9 exercises
- 02FilteringWHERE, AND/OR, IN, LIKE, BETWEEN and NULLs — keep only the rows you need.16 exercises
- 03Sorting & LimitingORDER BY and LIMIT on filtered data — put results in order and pick the top rows.26 exercises
- 04AggregationsCOUNT, SUM, AVG, GROUP BY and HAVING — turn rows into answers.74 exercises
- 05JOINsCombine tables with INNER, LEFT and self joins.75 exercises
- 06SubqueriesQueries inside queries: IN, EXISTS and correlated subqueries.54 exercises
- 07CTEsWITH clauses and recursive CTEs for readable multi-step queries.34 exercises
- 08Window FunctionsROW_NUMBER, RANK, LAG/LEAD and running totals.62 exercises
- 09Interview LevelReal-world analyst questions that mix everything you've learned.62 exercises
How it works
- 1
Read the question
Every problem is a real business ask — “which customers never ordered?”, “top 3 products per category?”
- 2
Write SQL
Query a real database right in your browser. Run it as often as you like and look at the rows.
- 3
Get instant feedback
Submit to check your answer. Wrong? See exactly why. Right? Earn XP and grow your streak.
Real data, real questions
Practice on the kind of tables you'll see at work
ecommerce.db
E-Commerce
Customers, orders, products, payments, reviews and shipping.
- customers
- categories
- products
- orders
- order_items
- payments
- reviews
- shipping
finance.db
Finance
Bank customers, accounts, transactions, cards and loans.
- customers
- accounts
- transactions
- cards
- loans
- payments
- branches
healthcare.db
Healthcare
Patients, doctors, visits, prescriptions, labs and billing.
- patients
- doctors
- departments
- visits
- prescriptions
- insurance
- lab_results
- billing
Your first query takes 30 seconds.
Free Google sign-in, nothing to install. Open a problem, write a SELECT, see the answer.
Start solving