SELECT and WHERE
Pick columns, keep the rows you want.
SELECT name, class
FROM student
WHERE gender = 'F';Free, no database to install, sample data ready. Run a query, then watch it work clause by clause.
SQL is written in one order and worked out in another. Step through it: the table after each clause, the rows that JOIN pairs, the ones WHERE drops, the groups GROUP BY makes.
As handy as VS Code on your computer, plus what it does not have: every step drawn.
Press Step and the code stops at each line: the lit line runs next, and every variable’s value sits beside it. Go back too, with the ← → keys.

Under the error, press “See how it went wrong”: the visualizer opens at the failing step, in red, with the reason in plain words. Step back through everything before it.

A link opens this very code. Or export a GIF of it running (light or dark, wide or tall) or a picture of the code, and post it to X, a chat, or embed it in a blog.

Each one can be stepped through and visualized. Change it, run it again.
Pick columns, keep the rows you want.
SELECT name, class
FROM student
WHERE gender = 'F';The three highest scores.
SELECT sid, cid, score
FROM enroll
ORDER BY score DESC
LIMIT 3;One row that sums up the whole table.
SELECT COUNT(*) AS n, AVG(score) AS avg_score, MAX(score) AS best
FROM enroll;The average per course, only the courses above 80.
SELECT c.title, AVG(e.score) AS avg_score
FROM enroll e
JOIN course c ON c.id = e.cid
GROUP BY c.title
HAVING AVG(e.score) > 80
ORDER BY avg_score DESC;Who scored 90 or more, and in which course.
SELECT s.name, c.title, e.score
FROM enroll e
JOIN student s ON s.id = e.sid
JOIN course c ON c.id = e.cid
WHERE e.score >= 90
ORDER BY e.score DESC;Students who take no course at all.
SELECT s.name
FROM student s
LEFT JOIN enroll e ON e.sid = s.id
WHERE e.sid IS NULL;Scores above the average of all scores.
SELECT sid, cid, score
FROM enroll
WHERE score > (SELECT AVG(score) FROM enroll)
ORDER BY score DESC;Turn scores into grades.
SELECT sid, score,
CASE
WHEN score >= 90 THEN 'A'
WHEN score >= 75 THEN 'B'
WHEN score >= 60 THEN 'C'
ELSE 'F'
END AS grade
FROM enroll
ORDER BY score DESC;Rank within each course, without grouping the rows away.
SELECT cid, sid, score,
RANK() OVER (PARTITION BY cid ORDER BY score DESC) AS rnk
FROM enroll
ORDER BY cid, rnk;Three tables joined, SUM per customer (the Shop database).
SELECT c.name, SUM(p.price * i.qty) AS spent
FROM customer c
JOIN orders o ON o.customer_id = c.id
JOIN order_item i ON i.order_id = o.id
JOIN product p ON p.id = i.product_id
GROUP BY c.name
ORDER BY spent DESC;The same table twice (the Company database).
SELECT e.name AS employee, m.name AS boss
FROM emp e
LEFT JOIN emp m ON m.id = e.manager_id
ORDER BY e.id;Your own table: change it and see the result. “Reset” puts the sample data back.
CREATE TABLE todo (
id INT PRIMARY KEY,
task VARCHAR(30),
done INT DEFAULT 0
);
INSERT INTO todo (id, task) VALUES (1, 'learn SELECT'), (2, 'learn JOIN'), (3, 'learn GROUP BY');
UPDATE todo SET done = 1 WHERE id = 1;
DELETE FROM todo WHERE id = 3;
SELECT * FROM todo;No and no. Open the page and write SQL; there is nothing to install.
MySQL 8.0’s dialect, run by our own engine in your browser: the same results and the same error messages for what it supports.
Three sample databases, picked from the database menu: School (student, course, enroll), Shop (customer, product, orders, order_item) and Company (dept, emp).
Yes: CREATE TABLE, INSERT, UPDATE and DELETE all work. Press Reset to put the sample data back.
The query in the order it is worked out — FROM, JOIN, WHERE, GROUP BY, HAVING, SELECT, ORDER BY, LIMIT — and the table after each one.
Yes: joins, grouping, subqueries and window functions are the usual questions, and seeing each step is the quickest way to understand a wrong answer.
Yes. Tap the code to write full screen, with keys for brackets, commas, quotes and *.
Share → Copy link: it opens the same query on the same database. You can also export a GIF of it running, or a picture of it.