Developer Tools
SQL Playground (SQLite Online)
Practice and run SQL in your browser on a real SQLite database — sample shop data included, joins, CTEs and window functions, import CSV/Excel as tables, open .db files and export results.
How to use
- 1Pick an example query or write your own against the sample tables (customers, products, orders, order_items).
- 2Run with Ctrl+Enter; results show as tables you can download as CSV.
- 3Import a CSV or Excel file as a new table, or open your own .db/.sqlite file.
Frequently asked questions
Which SQL dialect is this?
SQLite 3 — standard SELECT/INSERT/UPDATE/DELETE, JOINs, CTEs (WITH), window functions, JSON functions and more.
Is my database uploaded?
No. SQLite runs in your browser via WebAssembly; files you open never leave your device.
Are changes saved?
The database lives in memory. Use Download database to keep a copy of your changes.
A real SQLite database, running in a worker
The engine is SQLite 3 compiled to WebAssembly and executed in a background worker, not a parser that approximates SQL — JOINs, CTEs (WITH), window functions (OVER, RANK, running totals) and SQLite's JSON functions all work exactly as they would against a .db file on disk. Because it runs in a worker, a runaway query can be terminated with Stop without freezing the page, and the database is rolled back to its state immediately before that query — Stop undoes the whole statement, not just interrupts it mid-write.
Importing data infers types, it doesn't just dump text
Opening a CSV or Excel file creates a new table named after the file, and before creating it, the tool checks every column: if every non-empty value in a column parses as a number, that column is declared NUMERIC; otherwise it stays TEXT. This matters because it means an imported 'price' column actually sorts and sums correctly in SQL rather than comparing as strings. A .db or .sqlite file can also be opened directly and queried against its real schema, shown live in the sidebar with primary keys marked by a key icon.
Worked example: top customers by spend
The bundled sample database has customers, products, orders and order_items tables. The 'Top customers by spend' example query joins all four, excludes cancelled orders, and sums quantity × price per customer. Running it against the seeded data returns, in order: Grace Hopper — 2 orders, $763.98; Katherine Johnson — 1 order, $578.99; Ada Lovelace — 3 orders, $441.00; Margaret Hamilton — 1 order, $207.00; Linus Torvalds — $174.50; Guido van Rossum — $158.00; Alan Turing — $138.99; Tim Berners-Lee — $59.99. It's a real aggregation over real rows, so changing the WHERE clause or adding a HAVING total > 200 filter changes the result exactly as it would in production SQLite.
Why Stop rolls back instead of just halting mid-query
Because the engine runs in a Web Worker rather than on the page's main thread, a long-running or accidentally unbounded query (a missing WHERE clause on an UPDATE, or a cross join that balloons into millions of rows) doesn't freeze the browser tab the way an in-page SQLite call would — it keeps the UI responsive enough to click Stop. Stopping doesn't leave the database in a half-modified state from a partially completed statement; it rolls back to exactly where things stood before that statement ran, which matters specifically for write queries (UPDATE, DELETE, INSERT) where a partial execution could otherwise leave some rows changed and others not.
What opening your own .db file does and doesn't preserve
Opening an existing SQLite file loads its real schema, indexes and data exactly as they exist on disk, including primary keys (shown with a key icon in the sidebar) and any constraints already defined — this is a genuine SQLite file being read by a genuine SQLite engine, not a reinterpretation of it. What doesn't happen automatically is persistence back to that original file: the loaded database lives in the browser's memory for the session, and any changes need an explicit Download database click to produce a new file with those changes baked in, since the tool never writes back to a file on your filesystem without that explicit export step.
Related tools
- Online HTML, CSS & JS Editor (Live Preview)
Write HTML, CSS and JavaScript and see the result instantly — live preview, console, templates, shareable links and one-click HTML download. Like CodePen, with nothing to sign up for.
- JavaScript & TypeScript Playground
Run JavaScript or TypeScript in your browser with a real console — console.log, console.table, async/await, fetch and timers. Stop runaway loops, and share snippets as a link.
- Python Online Compiler & Playground
Write and run Python 3 in your browser — no install, no account. Real CPython (Pyodide) with input(), NumPy, pandas and Matplotlib charts, and shareable links.
- SQL Formatter
Format and beautify SQL queries for PostgreSQL, MySQL, SQL Server, SQLite, BigQuery and more, with uppercase keywords.
- CSV to SQL INSERT Generator
Generate SQL CREATE TABLE and INSERT statements from CSV data for MySQL, PostgreSQL, SQLite or SQL Server.
- String Escape / Unescape
Escape or unescape strings for JavaScript, JSON, HTML, XML, SQL, CSV and regular expressions — quotes, backslashes and newlines handled.