SQL concepts
Interactive SQL Visualizer
From SELECT and JOINs to subqueries, views, indexes, and stored procedures — every concept runs live in your browser.
Build SELECT / JOIN / GROUP BY visually and watch two tables become a result.
Basics
Joins
Aggregation
users4 rows
| id🔑 | name | city |
|---|---|---|
| 1 | Asha | Pune |
| 2 | Ravi | Mumbai |
| 3 | Neha | Pune |
| 4 | Kiran | Delhi |
orders5 rows
| id | user_id🔑 | amount | status |
|---|---|---|---|
| 101 | 1 | 1200 | paid |
| 102 | 1 | 800 | paid |
| 103 | 2 | 1500 | pending |
| 104 | 3 | 500 | paid |
| 105 | 5 | 999 | paid |
rows that match on the 🔑 key share a colour no partner — becomes NULL or is dropped, depending on the join
The query
SELECT *
FROM users
INNER JOIN orders ON users.id = orders.user_id;INNER JOIN
Only rows that match on both sides.
How it runs — clause by clause
FROM users
4rows
INNER JOIN orders
4rows
Result4 rows
| users.id | users.name | users.city | orders.id | orders.user_id | orders.amount | orders.status |
|---|---|---|---|---|---|---|
| 1 | Asha | Pune | 101 | 1 | 1200 | paid |
| 1 | Asha | Pune | 102 | 1 | 800 | paid |
| 2 | Ravi | Mumbai | 103 | 2 | 1500 | pending |
| 3 | Neha | Pune | 104 | 3 | 500 | paid |
INNER JOIN keeps only rows that match on both sides (users.id = orders.user_id). Kiran (no orders) and order #105 (no user) both disappear — only real pairs remain.
Build & customize the queryclick clauses to change the query above
SELECT — columns
FROM + JOIN
ON=
WHERE — filter rows
No filter — all rows pass.
GROUP BY · aggregate · ORDER BY
GROUP BY
Aggregate
ORDER BYLIMIT