SQL online editor: write and run queries in your browser
An SQL editor with nothing to install and no sign-up. Write a query, click Run and see the result as a table, on real practice data from an online shop and four more databases.
In short: pick a database, type a query or click an example, then press Run or Ctrl+Enter. Every run starts from the original data, so you cannot break anything. Nothing is stored on the server; only your browser remembers the query you are working on.
The database of the SQL course: a small online shop for office supplies with customers, products, employees, orders and order items.
customers 12 rows, 7 columns
- INTEGER Primary key
- TEXT
- TEXT
- TEXT
- TEXT
- TEXT
- TEXT
products 12 rows, 5 columns
- INTEGER Primary key
- TEXT
- TEXT
- REAL
- INTEGER
employees 10 rows, 7 columns
- INTEGER Primary key
- TEXT
- TEXT
- TEXT
- REAL
- TEXT
- INTEGER
orders 18 rows, 5 columns
- INTEGER Primary key
- INTEGER Foreign key, points to customers.customer_id
- TEXT
- TEXT
- INTEGER Foreign key, points to employees.employee_id
order_items 38 rows, 4 columns
- INTEGER Primary key Foreign key, points to orders.order_id
- INTEGER Primary key Foreign key, points to products.product_id
- INTEGER
- REAL
A single table with the shop's sales, one row per order line, June 2025 to June 2026. Good for GROUP BY before you learn JOIN.
sales 57 rows, 9 columns
- INTEGER Primary key
- INTEGER
- TEXT
- TEXT
- TEXT
- TEXT
- INTEGER
- REAL
- TEXT
A made-up online shop for kitchenware: orders from November 2025 to October 2026 and an extract of web tracking. From the SQL for data analysts course.
customers 70 rows, 6 columns
- INTEGER Primary key
- TEXT
- TEXT
- TEXT
- TEXT
- TEXT
products 24 rows, 4 columns
- INTEGER Primary key
- TEXT
- TEXT
- REAL
orders 122 rows, 5 columns
- INTEGER Primary key
- INTEGER
- TEXT
- TEXT
- REAL
order_items 193 rows, 5 columns
- INTEGER Primary key
- INTEGER Foreign key, points to orders.order_id
- INTEGER Foreign key, points to products.product_id
- INTEGER
- REAL
sessions 90 rows, 4 columns
- INTEGER Primary key
- TEXT
- TEXT
- TEXT
events 185 rows, 4 columns
- INTEGER Primary key
- INTEGER Foreign key, points to sessions.session_id
- TEXT
- TEXT
A made-up maker of bike accessories, January to June 2026: cost centers, accounts, ledger, budget, sales, invoices and payments. From the SQL for finance course.
cost_centers 8 rows, 4 columns
- INTEGER Primary key
- TEXT
- TEXT
- TEXT
accounts 13 rows, 3 columns
- INTEGER Primary key
- TEXT
- TEXT
ledger 169 rows, 8 columns
- INTEGER Primary key
- INTEGER
- TEXT
- INTEGER Foreign key, points to accounts.account_id
- INTEGER Foreign key, points to cost_centers.cost_center_id
- TEXT
- REAL
- REAL
budget 8 rows, 13 columns
- INTEGER Primary key Foreign key, points to cost_centers.cost_center_id
- REAL
- REAL
- REAL
- REAL
- REAL
- REAL
- REAL
- REAL
- REAL
- REAL
- REAL
- REAL
product_groups 4 rows, 3 columns
- INTEGER Primary key
- TEXT
- REAL
products 12 rows, 5 columns
- INTEGER Primary key
- TEXT
- INTEGER Foreign key, points to product_groups.group_id
- REAL
- REAL
sales 72 rows, 5 columns
- INTEGER Primary key
- INTEGER Foreign key, points to products.product_id
- TEXT
- INTEGER
- REAL
invoices 60 rows, 5 columns
- INTEGER Primary key
- TEXT
- TEXT
- TEXT
- REAL
payments 48 rows, 4 columns
- INTEGER Primary key
- INTEGER Foreign key, points to invoices.invoice_id
- TEXT
- REAL
bank_balance 1 rows, 2 columns
- TEXT
- REAL
cash_plan 51 rows, 5 columns
- INTEGER Primary key
- TEXT
- TEXT
- TEXT
- REAL
A made-up online store for sports gear: campaigns with costs, customers, orders and web analytics from October 2026. From the SQL for marketing course.
campaigns 14 rows, 6 columns
- INTEGER Primary key
- TEXT
- TEXT
- TEXT
- TEXT
- REAL
customers 140 rows, 6 columns
- INTEGER Primary key
- TEXT
- TEXT
- TEXT
- TEXT
- INTEGER Foreign key, points to campaigns.campaign_id
products 24 rows, 5 columns
- INTEGER Primary key
- TEXT
- TEXT
- REAL
- REAL
orders 239 rows, 6 columns
- INTEGER Primary key
- INTEGER Foreign key, points to customers.customer_id
- TEXT
- INTEGER Foreign key, points to campaigns.campaign_id
- TEXT
- REAL
order_items 297 rows, 4 columns
- INTEGER Primary key Foreign key, points to orders.order_id
- INTEGER Primary key Foreign key, points to products.product_id
- INTEGER
- REAL
sessions 300 rows, 5 columns
- INTEGER Primary key
- TEXT
- TEXT
- INTEGER Foreign key, points to campaigns.campaign_id
- INTEGER Foreign key, points to orders.order_id
Example queries to click
One click loads the query into the editor and runs it. Then change it: drop a column, add a condition, sort the other way. That teaches you more than an empty box.
How to use the SQL editor
- Pick a database. The default is the shop from the SQL course. Below it you see every table with its columns, data types and row count.
- Write a query. Tap a table or column name to insert it at the cursor. That saves typos, especially on a phone.
- Run it. Use the button or Ctrl+Enter (Cmd+Enter on a Mac). The result appears as a table; for long results you see the first 100 rows and the total.
- Read the error. If something is wrong, the message below the editor points to the cause: a misspelled column with a suggestion, a comma before FROM, text without quotes.
Try changing data
The editor also accepts INSERT, UPDATE, DELETE, CREATE TABLE and CREATE VIEW. Each run works on a fresh copy of the data that disappears afterwards. To see the effect of a change, put a query after it, separated by a semicolon, like the example above: UPDATE first, then SELECT. Up to ten statements run in one go, including BEGIN and ROLLBACK.
Which SQL runs here?
The editor uses SQLite, like the exercises in the course. The core commands are written the same way in MySQL, PostgreSQL and SQL Server: SELECT, WHERE, GROUP BY, JOIN, subqueries, WITH and window functions. The main differences are date functions and how you limit rows. See MySQL vs PostgreSQL vs SQL Server for an overview.
For security there are a few limits: at most 4,000 characters and ten statements per run, no recursive queries, no commands such as ATTACH or PRAGMA, and only the usual functions for text, numbers, dates and aggregates. Queries that would combine a huge number of rows, such as several tables joined without ON, are stopped before they run.
The databases
- Shop: the office supplies shop from the course with customers, products, employees, orders and order items.
- Sales list: one table with every sale, good for GROUP BY before JOIN.
- Analytics, Finance, Marketing: the data of the intensive courses, with more rows and tables for KPIs, budget vs actual and campaigns.
All databases can also be downloaded for SQLite, MySQL and PostgreSQL: download the SQL sample database.
From trying things to knowing them
A free editor is great for trying things out. To make it stick, exercises with a check help: the SQL practice exercises tell you whether your result is right, also on other data, and give hints when you are stuck. New tasks at the push of a button are in the random SQL exercises, and every command is in the SQL commands cheat sheet.
Frequently asked questions
Is the online SQL editor free?
Yes. You need no account and nothing to install. To keep the server healthy there is a limit of 300 runs per hour, which you will not notice during normal practice.
Can I create my own tables or upload my own data?
You can create tables with CREATE TABLE, but they only exist for one run. Uploading your own data is not possible. For your own projects, download the sample database and continue locally, for example with SQLite.
Is my query saved?
Not on the server. Your browser remembers the query per database so it is still there after a reload. Clear removes it.
Does the editor work on a phone?
Yes. Insert table and column names with the buttons above the input field, and swipe sideways through wide results.
Why does LIMIT work but not TOP?
TOP only exists in SQL Server. SQLite, MySQL and PostgreSQL limit rows with LIMIT at the end of the query. The editor's error message tells you that as well.