Developer tool

SQLite Playground

Create a table or paste a query. Data stays in this tab and is cleared when you reset.

Runs in your browser. No upload.

Values are processed locally in this browser.

Result

—

About this tool

SQLite Playground made simple.

This tool uses a local SQLite WebAssembly engine. Large queries need more memory; nothing is uploaded or saved remotely.

Guide

Using SQLite Playground

The SQLite Playground runs real SQLite, compiled to WebAssembly, inside a browser tab. You type SQL, press the run button and see the rows in a table. The database lives only in memory for that tab, so tables you create disappear when you press Reset or leave the page. It suits learning and trying queries, not storing data.

How to use it

  1. Type or paste SQL into the query box. It starts with SELECT 1 AS ready; and accepts up to 20,000 characters.
  2. Press the run button, which is labelled Calculate on the page. Results show as a table, and as tab-separated text in the Result box.
  3. Create a table and add rows in one go, ending with a SELECT so you can see the data. Later queries in the same tab can use that table.
  4. Press Reset to throw the database away and start with an empty one.

Worked examples

The default query

You enter
Sql
SELECT 1 AS ready;
You get
Columns
ready
Rows
1

A SELECT with no table returns one row. The status line says the result is ready and was computed locally. This was run in the real page in a browser.

Run through the tool’s own code.

Create, fill and group in one script

You enter
Sql
CREATE TABLE pets(id INTEGER PRIMARY KEY, name TEXT, species TEXT, age INTEGER); INSERT INTO pets(name,species,age) VALUES ('Mia','cat',4),('Rex','dog',7),('Tom','cat',2); SELECT species, COUNT(*) AS n, AVG(age) AS avg_age FROM pets GROUP BY species ORDER BY species;
You get
Columns
species; n; avg_age
Rows
cat; 2; 3; dog; 1; 7

Cats are aged 4 and 2, so the average is 3. The table pets stays in memory, so a later SELECT * FROM pets in the same tab returns all three rows until you press Reset.

Run through the tool’s own code.

A typo and a missing table

You enter
Sql
SELEC 1;
You get
Status
SQLITE_ERROR: sqlite3 result code 1: near "SELEC": syntax error

SQLite's own error message is shown in the status line and the result table is emptied. A query on a table that does not exist gives a similar message, such as no such table: pets after a Reset.

Run through the tool’s own code.

When it helps

  • Practise SELECT, JOIN and GROUP BY without installing a database.
  • Test a query idea quickly before putting it into an app.
  • Teach SQL basics in a class with nothing to set up.
  • Check how a SQLite function behaves, for example sqlite_version().

Limits to keep in mind

  • If a script holds several statements that return rows, only the first result set is shown. The later ones run but are not displayed.
  • Results are cut off at 500 rows. A longer result gives the message to add a LIMIT, and no rows are shown.
  • Statements like INSERT or UPDATE show an empty result with the same ready message, with no count of changed rows.
  • Data is kept only in memory in this tab and is not saved. Nothing is shared between visits, and the Clear and Copy result buttons gave no visible response in my test.

Tips

  • Put the SELECT you want to see last, and run one result-producing statement per run, since only the first set is shown.
  • Add LIMIT 50 to exploratory queries on big generated data to stay under the 500-row cap.
  • Keep your CREATE TABLE and INSERT statements in your own notes, because Reset and closing the tab remove them.

Sources

Common questions

About SQLite Playground.

Which SQLite version does it run?

It uses the sqlite-wasm package bundled with the site. In my test of the same package, sqlite_version() returned 3.53.4. You can run SELECT sqlite_version(); in the tool to see the version it uses.

Is my data uploaded or saved?

No. The database is created in memory in a web worker inside your tab. The page says nothing is uploaded or saved remotely, and the data is gone when you reset or close the tab.

Why does my INSERT show an empty result?

A statement that returns no rows produces an empty table and the usual ready message. The statement did run, so follow it with a SELECT in the same script to see the effect.

Why do I only see one result from several SELECTs?

When a script has more than one statement that returns rows, the tool displays only the first result set. Run the statements one at a time to see each one.

What is the row limit?

The preview shows at most 500 rows, and a query that returns more shows an error asking you to add LIMIT. The query text itself can be up to 20,000 characters.

Can I load a database file?

No file loading appears on the page. You can only type SQL and build tables in the empty in-memory database, then use Reset to start fresh.

Can it replace a real database tool?

No. It is for learning and quick tests. Nothing persists, results are capped, and it is no substitute for a proper database setup with backups for real data.

How do I use SQLite playground?

Create a table or paste a query. Data stays in this tab and is cleared when you reset.

Is my data uploaded to a server?

No. This tool runs locally in your browser. Your input is not uploaded.