Practice SQL online — free, no signup
SQLazo is a free SQL playground with a real database and 98 graded exercises. Write queries, get instant feedback, and follow a structured path from SELECT to window functions — all in your browser, no signup.
How practice works
Pick a topic
Start at the beginning or jump to what you need: filtering, joins, aggregates, subqueries, window functions…
Write a real query
The editor runs SQLite in your browser against a record-store database. No installation, no server, no account.
Get instant feedback
Every exercise is graded against a fresh database. If the rows match, it counts; hints and the full solution are one click away.
Start with a few exercises
Meet the artists
Every journey starts with a look around. Ask the artists table for everything it has — all columns, all rows.
Songs for a long drive
The boss is building a playlist for a long road trip and only wants the long songs. From tracks, get title and duration_sec for every tra…
Shortest first
The listening kiosk plays tracks from shortest to longest. Get title and duration_sec from tracks, sorted by duration, shortest first.
How big is the catalog?
Before we count money, let's count records. The owner wants a single number: how many tracks the store sells. Ask the tracks table.
Track to album
tracks only stores an album_id — a number that means nothing on its own. Join tracks with albums so that every row shows the track's titl…
The marathon queue
The store app is getting a "longest songs" screen. Number every track from 1 (longest) to 49 (shortest), ordering the results by duration…
What you can practice
- 1. First Queries — What a table is, and how to ask it for things.
- 2. Filtering — WHERE, comparisons, and the strange case of NULL.
- 3. Pattern Matching — LIKE, wildcards, and finding text you half-remember.
- 4. Sorting & Limiting — ORDER BY, LIMIT, and asking for "the top five".
- 5. Aggregates — COUNT, SUM, AVG and the art of GROUP BY.
- 6. String Functions — Cut, clean and glue text inside a query.
- 7. Numbers & Dates — Rounding, math, and making time behave.
- 8. Conditional Logic — CASE, COALESCE, and queries that make decisions.
- 9. Joins — The moment SQL starts earning its keep.
- 10. Subqueries — Queries inside queries, and when each kind fits.
- 11. Set Operations — UNION, INTERSECT, EXCEPT — stacking result sets.
- 12. Modifying Data — INSERT, UPDATE, DELETE — safely, in your own sandbox.
- 13. Window Functions — Rankings, running totals, and rows that see other rows.
- 14. CTEs & Capstone — WITH, recursive queries, and everything you know at once.
Practice FAQ
Is SQLazo really free?
Yes — the whole course, all 98 exercises and every lesson, is free. No paywalls, no trials.
Do I need an account to use the site?
No. You can do the entire course without registering. An optional account (Google, GitHub or email) only saves your progress across devices.
Where does the SQL actually run?
In your browser. The database is SQLite running as WebAssembly (sql.js) — queries never leave your machine. There is no server processing your SQL.
How does the grader decide if my query is correct?
It runs your query against a fresh copy of the database and compares the result rows with the expected ones. Values must match; column names and row order are usually free.