SQL Editor
iwantcoding.com ships an in-browser SQL editor — a real SQLite engine compiled to WebAssembly, with a sample shop database preloaded. Type SQL on the left, press Run », see the result on the right.
Open the SQL Editor »
Opens in this tab. Use the browser Back button to return.
What you can do
- Run any
SELECTagainst the preloaded sample database. - Run
INSERT,UPDATE,DELETE— they affect the in-memory DB until you click Reset DB. - Run
CREATE TABLE,CREATE VIEW,DROP,ALTER— every DDL statement SQLite supports. - Stack multiple statements separated by
;— each result is shown in turn. - Pick from 16 ready-made Sample queries in the toolbar dropdown.
The sample shop database
| Table | Rows | Columns |
|---|---|---|
customers | 12 | id, name, email, country, active, created_at |
products | 15 | id, category, name, price, stock |
orders | 12 | id, customer_id, total, status, created_at |
order_items | 20 | id, order_id, product_id, quantity, price |
employees | 11 | id, name, manager_id, salary |
Foreign keys are declared and customers like Ada Lovelace, Grace Hopper, and Linus Torvalds are in the data — so you'll see meaningful names in your joins, not customer_1.
Sample query — try this one
SQL
SELECT c.name, SUM(o.total) AS revenue FROM customers c JOIN orders o ON o.customer_id = c.id WHERE o.status = 'paid' GROUP BY c.id, c.name ORDER BY revenue DESC;
Keyboard shortcuts
| Shortcut | Does |
|---|---|
| Ctrl+Enter (or Cmd+Enter) | Run the SQL in the editor. |
| Tab | Indent (2 spaces). |
| Reset DB button | Drop everything and reseed — undoes any UPDATE/DELETE. |
What engine is it really running?
The editor uses sql.js 1.10 — a build of SQLite 3 compiled to WebAssembly. Everything happens inside your browser tab; no SQL leaves your machine. The same engine ships in iOS apps, Android apps, and embedded inside Laravel test runs.
Tip: SQLite is broadly compatible with standard SQL, but it has its own quirks — no real
BOOLEAN, looser typing, and a few date functions of its own. Anything called out as "MySQL syntax" or "SQL Server syntax" in the lessons may need a small tweak before it runs here.Example
Example
-- iwantcoding.com SQL editor — type SQL on the left, -- click Run to see the result table. SELECT 1 AS hello;Try it Yourself »
Exercise
Editor uses a sandboxed engine called…
Engine:
Six letters; single-file embedded DB.
Discussion
Loading…