Run real SQLite in your browser — sample store database, results grid, your own DDL welcome
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.
| Table | Rows | Key columns | What it holds |
|---|---|---|---|
customers | 6 | id PK | name, city, signup date |
products | 8 | id PK | name, category, price — 3 categories |
orders | 9 | id PK, customer_id FK | order date, status (8 usable, 1 cancelled) |
order_items | 16 | order_id, product_id | quantity 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';.
| Question | Query shape | Answer on this data |
|---|---|---|
| Revenue by category | 3-way JOIN + GROUP BY | Furniture $1,831.00 · Hardware $1,155.98 · Audio $518.97 |
| Items sold per category | COUNT(*) in the same GROUP BY | 6 · 6 · 3 |
| Average order value | subquery: SUM per order, then AVG | $438.24 across 8 orders |
| Revenue in shipped orders | WHERE status = 'shipped' | 6 items, $1,446.46 |
| Customers per city | GROUP BY city | Boston 2 · New York 2 · Helsinki 1 · London 1 |
| Top 3 spenders | CTE + 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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.