What you can do here
- Practise on realistic data: an online shop (customers, products, orders, order items) and a clinic (patients and appointments), or start from an empty database.
- See how tables connect: the Schema tab draws the tables, keys and links, with row counts and one-click starter queries.
- Chart any result: press Chart under a result for an instant bar chart, or download it as CSV.
- Learn performance: Query plan shows whether SQLite scans every row or uses an index.
- Run part of a script: Shift + Enter runs only the statement at the cursor, or the text you selected.
- Bring your own data: upload a CSV and it becomes a table, with column types detected.
- Understand errors: errors point to the statement and suggest the right column or table name.
Which SQL is this?
This is SQLite, the most widely used database engine, compiled to WebAssembly (sql.js). Standard SQL works: SELECT, JOIN, GROUP BY, HAVING, subqueries, CTEs (WITH), window functions (OVER, PARTITION BY, RANK, LAG), INSERT, UPDATE, DELETE and CREATE. A few names differ from PostgreSQL or MySQL: dates use strftime(), text joins with ||.
Is my data saved?
The database lives in your browser's memory. Changes last until you reload the page or switch database. Your query text is saved in this browser, and Share makes a link that contains it.
Examples
| Example | What it shows |
|---|---|
| Your first query | SELECT columns FROM a table, filter with WHERE, sort and limit. |
| Average order value by country | A CTE, two joins and GROUP BY. Press Chart under the result. |
| Join orders to customers | INNER JOIN matches rows on a shared key. |
| Top 5 products by revenue | Aggregate, then sort and LIMIT. |
| Customers with no orders (NULLs) | LEFT JOIN keeps rows with no match; the missing side becomes NULL. |
| Monthly revenue | Group by month with strftime(). Press Chart to draw it. |
| Running total per customer | Window functions: SUM() OVER and ROW_NUMBER(). |
| Best seller in each category | RANK() within a PARTITION, then keep rank 1. |
| Create, insert, update and delete | Build your own table. Changes last until you reload the page or change database. |
| No-show rate by waiting time | CASE builds buckets; AVG of a 0/1 column is a rate. Uses the clinic database. |
Learn more
Learn the ideas step by step in the free SQL & Databases course: SELECT, joins, grouping, subqueries, window functions and database design.
Questions
Is this SQL practice free?
Yes, with no sign-up. The database runs in your browser.
Is it MySQL, PostgreSQL or SQLite?
SQLite. Almost everything you learn here works the same in MySQL and PostgreSQL; the differences are mostly date and text functions.
Can I practise window functions and CTEs?
Yes. SQLite supports WITH, recursive CTEs and window functions such as ROW_NUMBER, RANK, LAG and running SUM.
Can I use my own data?
Yes. Upload a CSV and it becomes a table you can query.