Online SQL Playground
Run SQL online with SQLite in your browser: a sample shop database, result tables, a schema view, and import or export of .sqlite files. Nothing is uploaded.
Runs in your browser · Nothing uploadedFree · No sign-up
Something not working, or missing a feature? Send feedback
About the SQL Playground
The SQL Playground runs SQLite in your browser, so you can write and test SQL without installing a database. It works as a free SQL online compiler with a small shop database (customers, products, orders and order items) for practising joins, grouping and subqueries. Every statement's result is shown as a table, and you can open or export real .sqlite files.
Your code runs in an isolated Web Worker in your browser, so it never leaves your device.
How to use the SQL Playground
- Write SQL in the editor, or start from the sample query. Separate statements with semicolons.
- Press Run or Ctrl+Enter. Each statement that returns rows gets its own result table; others show how many rows they changed.
- Click a table in the schema panel to see its rows, use Reset sample to start over, or open your own .sqlite file.
- Copy any result as CSV, or export the whole database as a .sqlite file.
Common mistakes
- Filtering a LEFT JOIN in WHERE. A condition on the joined table in WHERE removes the rows the LEFT JOIN was meant to keep. Put it in the ON clause instead; the sample query shows both patterns.
- Comparing with = NULL. NULL = NULL is never true in SQL. Use IS NULL and IS NOT NULL.
- Expecting MySQL or PostgreSQL behaviour. SQLite accepts a value of any type in most columns and has its own date functions (date(), strftime()). Check the SQLite documentation before porting a query.
Works well with the SQL Playground
- SQL Formatter: format a long query before running it.
- JSON to SQL Insert: turn JSON data into INSERT statements to load.
- CSV to JSON: prepare CSV data for import.
Frequently asked questions
Which SQL dialect is this?
SQLite 3, compiled to WebAssembly (sql.js). It supports standard SQL including joins, subqueries, CTEs (WITH), window functions, views, triggers and JSON functions. A few things differ from MySQL or PostgreSQL: column types are flexible, dates are stored as text or numbers, and there are no stored procedures.
Is my data uploaded?
No. The database lives in your browser's memory inside a Web Worker. Opened .sqlite files are read locally, and nothing is sent to a server.
Do my changes persist?
Changes last until you reload the page, reset the sample or stop a query. Use Export to download the database as a .sqlite file and open it again later.
Why does a large SELECT show only 1,000 rows?
The playground counts every row but displays the first 1,000, so the page stays fast. Add LIMIT and OFFSET, or aggregate the data, to look at large tables.
Related tools
SQL Formatter
Format and beautify SQL queries online for MySQL, PostgreSQL, SQLite, SQL Server and more, with keyword casing and indentation options. Runs in your browser.
Runs in your browserSQL Minifier
Compress SQL queries onto a single line online, removing comments and redundant whitespace. Useful for logs, config files and embedding SQL in code.
Runs in your browserJSON to SQL Insert
Convert a JSON array of objects into SQL INSERT statements online for MySQL, PostgreSQL or SQLite. Seed databases and test fixtures in seconds.
Runs in your browserJavaScript Compiler
Run JavaScript online in an isolated browser sandbox. See console output, errors and execution time instantly, with top-level await and stdin input.
Runs in your browserTypeScript Compiler
Compile and run TypeScript online. Your code is type-checked with the official compiler in strict mode, then runs in a sandboxed worker in your browser.
Runs in your browserPython Compiler
Run Python 3 code online with the full standard library and stdin input. It runs in your browser with Pyodide (WebAssembly), so your code stays on your device.
Runs in your browser