SQL Practice Sandbox
Learn SQL with a working sample database, eight guided exercises, hints, checked results and reusable query notebooks.
Where can I practice SQL without setting up a server?
Load the fictional library database and work through eight read-only SQLite exercises covering filtering, sorting, aggregation, HAVING, inner and left joins, subqueries and window functions. Run your own queries, inspect the schema, ask for a hint or reveal a solution. Check results against the exercise’s expected values and row order. Download your queries and completion progress to continue later.
A closer look, on your device
A place to try SQL
No database open
Open a database or try the fictional library example.
Files stay on this device. Use a consistent database copy with completed transactions; separate WAL/journal files, encrypted databases and extensions are not supported. Closing this page clears the session. Download your queries before leaving.
0 of 8 exercises completed
Pick your columns
Return title and pages for every book, ordered by title A–Z.
Show a hint
SELECT chooses columns; ORDER BY makes the order explicit.
Show a solution
SELECT title, pages FROM books ORDER BY title;
Checks compare the requested values, number of columns and row order. Equivalent SQL is welcome; aliases may differ. Use the sample database for exercise checks.
Inside the database
Tables, views and relationships will appear here when you open a database.
A question for your data
One SELECT, WITH or EXPLAIN query. ⌘/Ctrl + Enter runs it. Database-changing commands are disabled.
Named parameters
For WHERE city = :city, use {":city":"Toronto"}. Values may be text, a finite number or null. Quote integers outside JavaScript’s safe range.
Saved queries (0/30)
Three simple steps
How to use SQL Practice Sandbox
Open a local SQLite file or load the fictional library database.
Inspect the schema, browse a table or run a read-only query. Named parameters let you reuse a query safely.
Download results as CSV or typed JSON, save the query text or keep a portable query notebook.
Common questions
Good to know
Understand the result.
Keep the original.
Is this tool free, and are my files uploaded?
This tool is free with no account required. The work happens in your browser. Your input and files are not sent to a processing server.
What are the limits and details?
Read-only SQLite SELECT/WITH/EXPLAIN queries in a dedicated browser worker. Unencrypted SQLite 3 files up to 8 MB, 200 tables/views, 100 result columns and 5,000 result rows. Queries stop after 12 seconds; SQLite has a 64 MiB heap cap, separate from browser and file-buffer memory. Result text is limited to eight million characters, 65,536 per cell and 32 KB per blob. WAL/journal sidecars and extensions are not loaded. Query notebooks contain SQL and progress, not database contents; nothing is synced or saved automatically.