SQL playground: write a query, run it, see the rows.
8 datasets are already loaded, each with related tables: orders and payments, subscriptions and invoices, flights and delays. Pick one, write SQL, and run it. Nothing to install and no account.
Customers, products, orders, order items, payments, and refunds. Good for joins across several tables and revenue by month.
8 datasets, each with tables that join.
The playground loads a linked sample of each dataset: a subset of customers, accounts, or products with all of their related rows, so keys match and joins behave as they do in the full files. Totals are smaller than in the downloads.
| Dataset | Tables | Rows loaded | What it contains |
|---|---|---|---|
| Ecommerce Sales & Returns | 6 | 4,663 | Customers, products, orders, order items, payments, and refunds. Good for joins across several tables and revenue by month. |
| SaaS Subscriptions & Churn | 5 | 7,200 | Plans, accounts, subscriptions, invoices, and payment attempts. Good for recurring revenue, churn, and matching invoices to payments. |
| Marketing Campaigns & Conversions | 4 | 7,526 | Campaigns, daily spend, leads, and conversions. Good for rates with the right denominator and LEFT JOIN practice. |
| Inventory & Supply Chain | 7 | 7,423 | Suppliers, products, warehouses, purchase orders, and stock movements. Good for reconciliation and running balances. |
| Workforce & Employee Attrition | 5 | 2,157 | Departments, roles, employees, employment records, and performance reviews. Good for headcount, rates, and ranking within a group. |
| AI Agent Operations | 8 | 5,885 | Agents and their versions, sessions, model calls, tool calls, and evaluations. Good for cost roll-ups and joins that can fan out. |
| Bike Sharing Demand | 2 | 3,653 | Hourly and daily bike rentals with weather and calendar columns. Good for time series and window functions over dates. |
| US Flight Delays | 4 | 2,271 | Flights between eight large US airports in 2025, with airlines, airports, and cancellation reasons. Good for rates by group and NULL handling. |
5 queries, one technique each.
Each link opens the playground with the dataset chosen and the query in the editor. Run it, then change it.
- Ecommerce Sales & Returns · A CTE, then SUM() OVER (ORDER BY ...)
Monthly order value with a running total
Open this query in the playground →WITH monthly AS ( SELECT substr(ordered_at, 1, 7) AS month, ROUND(SUM(order_total), 2) AS order_value FROM orders WHERE order_status <> 'cancelled' GROUP BY 1 ) SELECT month, order_value, ROUND(SUM(order_value) OVER (ORDER BY month), 2) AS running_order_value FROM monthly ORDER BY month; - Workforce & Employee Attrition · LEFT JOIN, then count the rows with no match
Employees who have never had a performance review
Open this query in the playground →SELECT d.department_name, COUNT(*) AS employees, SUM(CASE WHEN r.employee_id IS NULL THEN 1 ELSE 0 END) AS never_reviewed FROM employment_records AS e JOIN departments AS d ON d.department_id = e.department_id LEFT JOIN ( SELECT DISTINCT employee_id FROM performance_reviews ) AS r ON r.employee_id = e.employee_id GROUP BY d.department_name ORDER BY never_reviewed DESC, d.department_name; - SaaS Subscriptions & Churn · Date arithmetic with julianday(), and a blank end date
How long cancelled subscriptions lasted, by plan
Open this query in the playground →SELECT p.plan_name, COUNT(*) AS cancelled_subscriptions, ROUND(AVG(julianday(s.ended_at) - julianday(s.started_at))) AS avg_days_active, ROUND(MIN(julianday(s.ended_at) - julianday(s.started_at))) AS shortest_days, ROUND(MAX(julianday(s.ended_at) - julianday(s.started_at))) AS longest_days FROM subscriptions AS s JOIN plans AS p ON p.plan_id = s.plan_id WHERE s.ended_at <> '' GROUP BY p.plan_name ORDER BY avg_days_active DESC; - Bike Sharing Demand · A window frame: ROWS BETWEEN 6 PRECEDING AND CURRENT ROW
Seven-day moving average of daily rentals
Open this query in the playground →SELECT dteday, cnt AS rentals, ROUND(AVG(cnt) OVER ( ORDER BY dteday ROWS BETWEEN 6 PRECEDING AND CURRENT ROW ), 0) AS avg_7_day FROM day ORDER BY dteday LIMIT 60; - US Flight Delays · GROUP BY two columns, with a rate from AVG of a 0/1 flag
Busiest routes and how often they are cancelled
Open this query in the playground →SELECT origin_airport || ' to ' || dest_airport AS route, COUNT(*) AS flights, ROUND(AVG(cancelled), 3) AS cancelled_share FROM flights GROUP BY origin_airport, dest_airport ORDER BY flights DESC, route LIMIT 10;
SQLite in the browser, and where it differs from a warehouse.
The engine is SQLite compiled to WebAssembly. SELECT, every join type, GROUP BY and HAVING, CASE, CTEs, recursive CTEs, and window functions with frames all work and are written the same way in BigQuery, Snowflake, and Postgres. These are the differences you will meet:
| In a warehouse | In the playground | Note |
|---|---|---|
| DATE_TRUNC('month', ordered_at) | strftime('%Y-%m-01', ordered_at) | Or substr(ordered_at, 1, 7) for a year-month label. |
| DATEDIFF or DATE_DIFF between two dates | julianday(later) - julianday(earlier) | Returns days, with a fraction when the values include a time. |
| QUALIFY ROW_NUMBER() OVER (...) = 1 | Compute the window function in a CTE, then filter on it | QUALIFY is not part of SQLite. The CTE form works in every engine. |
| DATEADD(month, 1, d) or d + INTERVAL '1 month' | date(d, '+1 month') | Modifiers such as '-7 days' and 'start of month' work the same way. |
The playground is read-only. A query has to start with SELECT or WITH, and results show the first 200 rows.
From a blank editor to graded questions.
- GradedSQL interview questions you can run
Ten business problems on these same tables. Your result is checked against the expected rows.
- GradedSQL practice by topic
Exercises on joins, aggregation, CASE, CTEs, and window functions, each checked in the browser.
- VisualSQL join visualizer
See which rows an INNER, LEFT, RIGHT, or FULL OUTER JOIN keeps, drops, and multiplies.
- DownloadThe full datasets
Every dataset here as CSV, Excel, and SQLite files, with a data dictionary and a license.
About the SQL playground
- Is the SQL playground free?
- Yes. The editor, the datasets, and the results are free, and there is no account to create. The queries run in your own browser, so there is nothing to install either.
- Which SQL dialect does the playground use?
- SQLite, compiled to WebAssembly so it runs in the browser. Joins (including RIGHT and FULL OUTER), GROUP BY, CASE, CTEs, recursive CTEs, and window functions are standard SQL and behave as they do in BigQuery, Snowflake, and Postgres. Date functions are the main difference: SQLite uses date(), strftime(), and julianday() where a warehouse uses DATE_TRUNC and DATEDIFF, and it has no QUALIFY clause.
- What data can I query?
- 8 datasets, each with its own tables: online store orders and refunds, software subscriptions and invoices, marketing spend and leads, inventory and purchase orders, employees and reviews, AI agent sessions, bike rentals, and US flights. The playground loads a linked sample of each one so it opens quickly; the full files can be downloaded from the dataset pages.
- Can I create tables or insert my own data?
- No. The playground is read-only: a query has to start with SELECT or WITH, and statements that change data are blocked. Results show the first 200 rows. To work with your own tables, download a dataset as a SQLite file and open it in a desktop client.
- Is my query sent to a server?
- No. The dataset is downloaded once, loaded into a database in your browser's memory, and queried there. What you type is not uploaded or stored, and closing the tab discards it.
- Why does IS NULL return no rows on some columns?
- In the generated business datasets a missing value is stored as an empty string, the way it appears in the CSV files. An active subscription has ended_at = '' and an undelivered purchase order has received_at = ''. Filter with = '' or <> '' on those columns. The flight delays data uses real NULLs, so IS NULL works there.
