Skip to content
SQL playground · runs in your browser

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.

Dataset

Customers, products, orders, order items, payments, and refunds. Good for joins across several tables and revenue by month.

Starter queries
Loading the SQL engine and dataset sample…
ecommerce-sales.sql
Loading editor…
Ctrl/⌘ + Enter runs the query. Results show up to 200 rows.
What is loaded

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.

DatasetTablesRows loadedWhat it contains
Ecommerce Sales & Returns64,663Customers, products, orders, order items, payments, and refunds. Good for joins across several tables and revenue by month.
SaaS Subscriptions & Churn57,200Plans, accounts, subscriptions, invoices, and payment attempts. Good for recurring revenue, churn, and matching invoices to payments.
Marketing Campaigns & Conversions47,526Campaigns, daily spend, leads, and conversions. Good for rates with the right denominator and LEFT JOIN practice.
Inventory & Supply Chain77,423Suppliers, products, warehouses, purchase orders, and stock movements. Good for reconciliation and running balances.
Workforce & Employee Attrition52,157Departments, roles, employees, employment records, and performance reviews. Good for headcount, rates, and ranking within a group.
AI Agent Operations85,885Agents and their versions, sessions, model calls, tool calls, and evaluations. Good for cost roll-ups and joins that can fan out.
Bike Sharing Demand23,653Hourly and daily bike rentals with weather and calendar columns. Good for time series and window functions over dates.
US Flight Delays42,271Flights between eight large US airports in 2025, with airlines, airports, and cancellation reasons. Good for rates by group and NULL handling.
Queries to try

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

    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;
    Open this query in the playground →
  • Workforce & Employee Attrition · LEFT JOIN, then count the rows with no match

    Employees who have never had a performance review

    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;
    Open this query in the playground →
  • SaaS Subscriptions & Churn · Date arithmetic with julianday(), and a blank end date

    How long cancelled subscriptions lasted, by plan

    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;
    Open this query in the playground →
  • Bike Sharing Demand · A window frame: ROWS BETWEEN 6 PRECEDING AND CURRENT ROW

    Seven-day moving average of daily rentals

    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;
    Open this query in the playground →
  • 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

    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;
    Open this query in the playground →
The SQL it runs

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 warehouseIn the playgroundNote
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 datesjulianday(later) - julianday(earlier)Returns days, with a fraction when the values include a time.
QUALIFY ROW_NUMBER() OVER (...) = 1Compute the window function in a CTE, then filter on itQUALIFY 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.

When you want your answer checked

From a blank editor to graded questions.

Questions

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.