What it does
Loads a CSV file from your device, or a built-in sample table of 30 orders (click Try sample data). The table is called
data.Runs SELECT queries with DISTINCT, WHERE (including LIKE, IN, BETWEEN and IS NULL), GROUP BY, HAVING, ORDER BY, LIMIT and OFFSET, and the aggregates COUNT, SUM, AVG, MIN, MAX and GROUP_CONCAT.
Works out each column's type from its values, so number comparisons and sums behave as expected.
Runs entirely in the page. The file is never uploaded, and nobody needs an account, which keeps it usable in schools with strict data protection rules.
What it leaves out
It queries one table. JOIN, subqueries, window functions and UNION are rejected with a clear error that names the missing feature, and so is anything that writes data. That makes it a good first step before a full database system, not a replacement for one.
A first query
SELECT country, COUNT(*) AS orders
FROM data
GROUP BY country
ORDER BY orders DESCOn the sample data this lists nine countries: Germany first with 6 orders, then the Netherlands and the United States with 5 each.
Ideas for class
A first SQL lesson. The 45-minute exercise on sales data has six tasks with solutions.
Open data. Download a CSV from an open data portal and let learners ask their own questions of it.
Spreadsheet versus SQL. Answer the same question once with a pivot table and once with a query, then compare which one you could still read a week later.
Using this page
The tool is free to use. This description and the ideas on it are licensed under CC BY 4.0.
