Skip to content
Devtoolry

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

  1. Write SQL in the editor, or start from the sample query. Separate statements with semicolons.
  2. Press Run or Ctrl+Enter. Each statement that returns rows gets its own result table; others show how many rows they changed.
  3. Click a table in the schema panel to see its rows, use Reset sample to start over, or open your own .sqlite file.
  4. 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

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.