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.
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 starts with a small shop database (customers, products, orders and order items) for practising joins, grouping and subqueries, shows every statement's result as a table, and 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
JavaScript Compiler
Run JavaScript online in an isolated browser sandbox. See console output, errors and execution time instantly, with top-level await and stdin input.
TypeScript 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.
Python 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.
PHP Compiler
Run PHP 8.4 code online and see the output instantly, with stdin input and mbstring. PHP runs in your browser with WebAssembly, so your code stays private.
C Compiler
Compile and run C code online with Clang 21 and stdin input. Your program is compiled to WebAssembly and runs in your browser, so the code stays on your device.
C++ Compiler
Compile and run C++20 code online with Clang 21, libc++ and stdin input. Programs compile to WebAssembly and run in your browser, so your code stays private.