Answer: this is a full SQL engine in a tab. SQLite 3.49, compiled to WebAssembly (~650 KB, loaded once from a CDN), runs a four-table sample store — 6 customers, 8 products, 9 orders, 16 line items. Write any SQL: the default GROUP BY query returns Furniture $1,831.00 · Hardware $1,155.98 · Audio $518.97 in revenue. CREATE your own tables, DROP anything, reset to restore. Nothing you type is uploaded anywhere.

Query Editor

Loading SQLite engine…
Advertisement

Sample Database Schema

TableRowsKey columnsWhat it holds
customers6id PKname, city, signup date
products8id PKname, category, price — 3 categories
orders9id PK, customer_id FKorder date, status (8 usable, 1 cancelled)
order_items16order_id, product_idquantity per product per order

Try SELECT * FROM sqlite_master; to see the raw DDL, or .tables-style exploration via SELECT name FROM sqlite_master WHERE type='table';.

Worked Queries (Verified Outputs)

QuestionQuery shapeAnswer on this data
Revenue by category3-way JOIN + GROUP BYFurniture $1,831.00 · Hardware $1,155.98 · Audio $518.97
Items sold per categoryCOUNT(*) in the same GROUP BY6 · 6 · 3
Average order valuesubquery: SUM per order, then AVG$438.24 across 8 orders
Revenue in shipped ordersWHERE status = 'shipped'6 items, $1,446.46
Customers per cityGROUP BY cityBoston 2 · New York 2 · Helsinki 1 · London 1
Top 3 spendersCTE + join back to customers$998.49 · $697.50 · $578.00

Every number above comes from running the exact queries on this page's sample data with the same SQLite build — load the chips in the editor and check them yourself.

How the SQL Playground Works

Most "run SQL online" sites round-trip your query to a server. This one doesn't ship your SQL anywhere: it loads sql.js — SQLite (public domain) compiled to WebAssembly by the sql.js project (MIT) — from the jsDelivr CDN and executes it in the page. The engine is the real thing, version 3.49.1, not a SQL subset reimplementation, so CTEs, window functions, and date functions all behave exactly as they do in the sqlite3 CLI.

The sample data

A tiny online store, because store data exercises every join shape: customers to orders is one-to-many, orders to products is many-to-many through order_items. The sample ships four tables you can query immediately, corrupt deliberately, and rebuild with one click. Prices are round enough to sanity-check by hand — when the revenue-by-category query says Furniture earned $1,831.00, you can verify that with a calculator if you're suspicious.

How to use it

Hit Run (or Ctrl/Cmd+Enter) to execute everything in the editor top to bottom. The results grid shows the last SELECT's output; message statements report how many statements ran. The chips load worked examples from easiest to hardest. Write your own DDL freely — CREATE TABLE, INSERT, UPDATE, DELETE all work, and Reset restores the original database.

A worked example

Take the default query: join order_items to products (for prices) and orders (for status), skip the one cancelled order, group by category, and sum price times quantity. Three rows come back. Furniture wins with 6 items and $1,831.00 — two standing desks at $549 plus an ergonomic chair and other bits. Hardware lands at 6 items and $1,155.98, Audio at 3 items and $518.97. The average order value across the 8 surviving orders is $438.24. Change a quantity with an UPDATE, rerun, and watch the numbers move — that feedback loop is the whole point of a playground.

Frequently Asked Questions

Can I practice SQL online without installing anything?

Yes. This playground runs a complete SQLite database engine compiled to WebAssembly inside your browser tab. There's no server holding your queries and no signup — the sample database loads locally, your SQL runs locally, and resetting just rebuilds it in memory.

Which SQL dialect does this playground use?

SQLite 3.49. The core vocabulary — SELECT, JOIN, GROUP BY, subqueries, window functions, CTEs — is shared with every major database, so it's ideal for learning. A few things differ from PostgreSQL or MySQL: INTEGER PRIMARY KEY is SQLite's row-id alias, types are flexible rather than strict, and functions like STRING_AGG spell differently. Your query logic transfers; occasional syntax doesn't.

Can I create my own tables?

Yes. The editor accepts any mix of statements — CREATE TABLE, INSERT, UPDATE, DELETE, DROP — followed by a SELECT. Everything runs in order against the in-memory database, and the results grid shows the output of your last SELECT. Hit Reset sample DB to restore the original four tables.

How big is the download?

The WebAssembly build of SQLite is about 650 KB, fetched once from a CDN when you first run a query. After that, everything happens in memory — queries on the sample database return in well under a millisecond, and no query or result ever leaves your machine.

Why learn SQL on a store database?

Because a shop is the most common shape of real data: customers place orders, orders contain items, items reference products. Almost every SQL concept — inner joins, aggregation, grouping, filtering after aggregation with HAVING, subqueries — maps onto a question a store owner would actually ask, like revenue by category or average order value.

Do my queries and tables survive a page refresh?

No. The database lives in the tab's memory, so a refresh rebuilds the sample data from scratch. That's deliberate for a playground — you can experiment freely, DROP anything, and always get back to a known state. For work you want to keep, copy your statements out before closing the tab.

Advertisement