Edit the SQL below and click Run. Queries execute on a small in-memory SQLite database with sample data.
WHERE filter (ex: country = 'India') and run again.SQL Tutorial
Learn SQL Tutorial with a small query you can edit and run.
statement;
Edit the SQL below and click Run. The output panel shows a table (for SELECT) or rows affected (for other statements).
SELECT *, then narrow the columns and add filters.| Line | Meaning |
|---|---|
SELECT 'Hello SQL' AS message; | Selects columns/expressions. |
- 1Reporting dashboards, analytics, and backend APIs read data with SQL.
- 1Forgetting a WHERE clause in UPDATE/DELETE.
- 1Start with SELECT * then narrow columns + filters.
- 1Practice the query on sample data, then apply the same pattern to real tables.
- 2Read query output carefully and verify counts when joining/grouping.
- 1Change one clause (WHERE/JOIN/GROUP BY) and predict the row count.
- 2Add a new column to SELECT and rename it with AS.
- 3Write the same query in a slightly different way and compare results.
SQL HOME
Learn SQL HOME with a small query you can edit and run.
statement;
Edit the SQL below and click Run. The output panel shows a table (for SELECT) or rows affected (for other statements).
SELECT *, then narrow the columns and add filters.| Line | Meaning |
|---|---|
SELECT 'Hello SQL' AS message; | Selects columns/expressions. |
- 1Reporting dashboards, analytics, and backend APIs read data with SQL.
- 1Forgetting a WHERE clause in UPDATE/DELETE.
- 1Start with SELECT * then narrow columns + filters.
- 1Practice the query on sample data, then apply the same pattern to real tables.
- 2Read query output carefully and verify counts when joining/grouping.
- 1Change one clause (WHERE/JOIN/GROUP BY) and predict the row count.
- 2Add a new column to SELECT and rename it with AS.
- 3Write the same query in a slightly different way and compare results.
SQL Intro
Learn SQL Intro with a small query you can edit and run.
statement;
Edit the SQL below and click Run. The output panel shows a table (for SELECT) or rows affected (for other statements).
SELECT *, then narrow the columns and add filters.| Line | Meaning |
|---|---|
SELECT 'Hello SQL' AS message; | Selects columns/expressions. |
- 1Reporting dashboards, analytics, and backend APIs read data with SQL.
- 1Forgetting a WHERE clause in UPDATE/DELETE.
- 1Start with SELECT * then narrow columns + filters.
- 1Practice the query on sample data, then apply the same pattern to real tables.
- 2Read query output carefully and verify counts when joining/grouping.
- 1Change one clause (WHERE/JOIN/GROUP BY) and predict the row count.
- 2Add a new column to SELECT and rename it with AS.
- 3Write the same query in a slightly different way and compare results.
SQL Syntax
Learn SQL Syntax with a small query you can edit and run.
statement;
Edit the SQL below and click Run. The output panel shows a table (for SELECT) or rows affected (for other statements).
SELECT *, then narrow the columns and add filters.| Line | Meaning |
|---|---|
SELECT customer_name, city | Selects columns/expressions. |
FROM customers | Chooses the source table(s). |
WHERE country = 'India' | Filters rows before grouping. |
ORDER BY customer_name ASC; | Sorts the result set. |
- 1Reporting dashboards, analytics, and backend APIs read data with SQL.
- 1Forgetting a WHERE clause in UPDATE/DELETE.
- 1Start with SELECT * then narrow columns + filters.
- 1Practice the query on sample data, then apply the same pattern to real tables.
- 2Read query output carefully and verify counts when joining/grouping.
- 1Change one clause (WHERE/JOIN/GROUP BY) and predict the row count.
- 2Add a new column to SELECT and rename it with AS.
- 3Write the same query in a slightly different way and compare results.
SQL Select
Learn SQL Select with a small query you can edit and run.
SELECT columns
FROM table
WHERE condition
ORDER BY column DESC
LIMIT 10;
Edit the SQL below and click Run. The output panel shows a table (for SELECT) or rows affected (for other statements).
SELECT *, then narrow the columns and add filters.| Line | Meaning |
|---|---|
SELECT customer_name, country | Selects columns/expressions. |
FROM customers; | Chooses the source table(s). |
- 1Reporting dashboards, analytics, and backend APIs read data with SQL.
- 1Forgetting a WHERE clause in UPDATE/DELETE.
- 1Start with SELECT * then narrow columns + filters.
- 1Practice the query on sample data, then apply the same pattern to real tables.
- 2Read query output carefully and verify counts when joining/grouping.
- 1Change one clause (WHERE/JOIN/GROUP BY) and predict the row count.
- 2Add a new column to SELECT and rename it with AS.
- 3Write the same query in a slightly different way and compare results.
SQL Select Distinct
Learn SQL Select Distinct with a small query you can edit and run.
SELECT columns
FROM table
WHERE condition
ORDER BY column DESC
LIMIT 10;
Edit the SQL below and click Run. The output panel shows a table (for SELECT) or rows affected (for other statements).
SELECT *, then narrow the columns and add filters.| Line | Meaning |
|---|---|
SELECT DISTINCT country | Selects columns/expressions. |
FROM customers; | Chooses the source table(s). |
- 1Reporting dashboards, analytics, and backend APIs read data with SQL.
- 1Forgetting a WHERE clause in UPDATE/DELETE.
- 1Start with SELECT * then narrow columns + filters.
- 1Practice the query on sample data, then apply the same pattern to real tables.
- 2Read query output carefully and verify counts when joining/grouping.
- 1Change one clause (WHERE/JOIN/GROUP BY) and predict the row count.
- 2Add a new column to SELECT and rename it with AS.
- 3Write the same query in a slightly different way and compare results.
SQL Where
Learn SQL Where with a small query you can edit and run.
statement;
Edit the SQL below and click Run. The output panel shows a table (for SELECT) or rows affected (for other statements).
SELECT *, then narrow the columns and add filters.| Line | Meaning |
|---|---|
SELECT id, total_amount | Selects columns/expressions. |
FROM orders | Chooses the source table(s). |
WHERE total_amount > 500 | Filters rows before grouping. |
ORDER BY total_amount DESC; | Sorts the result set. |
- 1Reporting dashboards, analytics, and backend APIs read data with SQL.
- 1Forgetting a WHERE clause in UPDATE/DELETE.
- 1Start with SELECT * then narrow columns + filters.
- 1Practice the query on sample data, then apply the same pattern to real tables.
- 2Read query output carefully and verify counts when joining/grouping.
- 1Change one clause (WHERE/JOIN/GROUP BY) and predict the row count.
- 2Add a new column to SELECT and rename it with AS.
- 3Write the same query in a slightly different way and compare results.
SQL Order By
Learn SQL Order By with a small query you can edit and run.
statement;
Edit the SQL below and click Run. The output panel shows a table (for SELECT) or rows affected (for other statements).
SELECT *, then narrow the columns and add filters.| Line | Meaning |
|---|---|
SELECT customer_name, city | Selects columns/expressions. |
FROM customers | Chooses the source table(s). |
ORDER BY city ASC, customer_name ASC; | Sorts the result set. |
- 1Reporting dashboards, analytics, and backend APIs read data with SQL.
- 1Forgetting a WHERE clause in UPDATE/DELETE.
- 1Start with SELECT * then narrow columns + filters.
- 1Practice the query on sample data, then apply the same pattern to real tables.
- 2Read query output carefully and verify counts when joining/grouping.
- 1Change one clause (WHERE/JOIN/GROUP BY) and predict the row count.
- 2Add a new column to SELECT and rename it with AS.
- 3Write the same query in a slightly different way and compare results.
SQL And
Learn SQL And with a small query you can edit and run.
statement;
Edit the SQL below and click Run. The output panel shows a table (for SELECT) or rows affected (for other statements).
SELECT *, then narrow the columns and add filters.| Line | Meaning |
|---|---|
SELECT customer_name | Selects columns/expressions. |
FROM customers | Chooses the source table(s). |
WHERE country = 'India' AND city = 'Mumbai'; | Filters rows before grouping. |
- 1Reporting dashboards, analytics, and backend APIs read data with SQL.
- 1Forgetting a WHERE clause in UPDATE/DELETE.
- 1Start with SELECT * then narrow columns + filters.
- 1Practice the query on sample data, then apply the same pattern to real tables.
- 2Read query output carefully and verify counts when joining/grouping.
- 1Change one clause (WHERE/JOIN/GROUP BY) and predict the row count.
- 2Add a new column to SELECT and rename it with AS.
- 3Write the same query in a slightly different way and compare results.
SQL Or
Learn SQL Or with a small query you can edit and run.
statement;
Edit the SQL below and click Run. The output panel shows a table (for SELECT) or rows affected (for other statements).
SELECT *, then narrow the columns and add filters.| Line | Meaning |
|---|---|
SELECT customer_name | Selects columns/expressions. |
FROM customers | Chooses the source table(s). |
WHERE country = 'USA' OR country = 'UK'; | Filters rows before grouping. |
- 1Reporting dashboards, analytics, and backend APIs read data with SQL.
- 1Forgetting a WHERE clause in UPDATE/DELETE.
- 1Start with SELECT * then narrow columns + filters.
- 1Practice the query on sample data, then apply the same pattern to real tables.
- 2Read query output carefully and verify counts when joining/grouping.
- 1Change one clause (WHERE/JOIN/GROUP BY) and predict the row count.
- 2Add a new column to SELECT and rename it with AS.
- 3Write the same query in a slightly different way and compare results.
SQL Not
Learn SQL Not with a small query you can edit and run.
statement;
Edit the SQL below and click Run. The output panel shows a table (for SELECT) or rows affected (for other statements).
SELECT *, then narrow the columns and add filters.| Line | Meaning |
|---|---|
SELECT customer_name, country | Selects columns/expressions. |
FROM customers | Chooses the source table(s). |
WHERE NOT country = 'India'; | Filters rows before grouping. |
- 1Reporting dashboards, analytics, and backend APIs read data with SQL.
- 1Forgetting a WHERE clause in UPDATE/DELETE.
- 1Start with SELECT * then narrow columns + filters.
- 1Practice the query on sample data, then apply the same pattern to real tables.
- 2Read query output carefully and verify counts when joining/grouping.
- 1Change one clause (WHERE/JOIN/GROUP BY) and predict the row count.
- 2Add a new column to SELECT and rename it with AS.
- 3Write the same query in a slightly different way and compare results.
SQL Insert Into
Learn SQL Insert Into with a small query you can edit and run.
INSERT INTO table (col1, col2)
VALUES (val1, val2);
Edit the SQL below and click Run. The output panel shows a table (for SELECT) or rows affected (for other statements).
SELECT *, then narrow the columns and add filters.| Line | Meaning |
|---|---|
INSERT INTO customers (customer_name, city, country) | Inserts new row(s). |
VALUES ('Zara', 'Dubai', 'UAE'); | SQL statement line. |
SELECT customer_name, country | Selects columns/expressions. |
FROM customers | Chooses the source table(s). |
ORDER BY id DESC | Sorts the result set. |
LIMIT 3; | Limits how many rows are returned. |
- 1Reporting dashboards, analytics, and backend APIs read data with SQL.
- 1Forgetting a WHERE clause in UPDATE/DELETE.
- 1Start with SELECT * then narrow columns + filters.
- 1Practice the query on sample data, then apply the same pattern to real tables.
- 2Read query output carefully and verify counts when joining/grouping.
- 1Change one clause (WHERE/JOIN/GROUP BY) and predict the row count.
- 2Add a new column to SELECT and rename it with AS.
- 3Write the same query in a slightly different way and compare results.
SQL Null Values
Learn SQL Null Values with a small query you can edit and run.
statement;
Edit the SQL below and click Run. The output panel shows a table (for SELECT) or rows affected (for other statements).
SELECT *, then narrow the columns and add filters.| Line | Meaning |
|---|---|
SELECT customer_name, city | Selects columns/expressions. |
FROM customers | Chooses the source table(s). |
WHERE city IS NULL; | Filters rows before grouping. |
- 1Reporting dashboards, analytics, and backend APIs read data with SQL.
- 1Forgetting a WHERE clause in UPDATE/DELETE.
- 1Start with SELECT * then narrow columns + filters.
- 1Practice the query on sample data, then apply the same pattern to real tables.
- 2Read query output carefully and verify counts when joining/grouping.
- 1Change one clause (WHERE/JOIN/GROUP BY) and predict the row count.
- 2Add a new column to SELECT and rename it with AS.
- 3Write the same query in a slightly different way and compare results.
SQL Update
Learn SQL Update with a small query you can edit and run.
UPDATE table
SET col = value
WHERE condition;
Edit the SQL below and click Run. The output panel shows a table (for SELECT) or rows affected (for other statements).
SELECT *, then narrow the columns and add filters.| Line | Meaning |
|---|---|
UPDATE customers | Updates existing row(s). |
SET city = 'Pune' | SQL statement line. |
WHERE customer_name = 'Aarav'; | Filters rows before grouping. |
SELECT customer_name, city | Selects columns/expressions. |
FROM customers | Chooses the source table(s). |
WHERE customer_name = 'Aarav'; | Filters rows before grouping. |
- 1Reporting dashboards, analytics, and backend APIs read data with SQL.
- 1Forgetting a WHERE clause in UPDATE/DELETE.
- 1Start with SELECT * then narrow columns + filters.
- 1Practice the query on sample data, then apply the same pattern to real tables.
- 2Read query output carefully and verify counts when joining/grouping.
- 1Change one clause (WHERE/JOIN/GROUP BY) and predict the row count.
- 2Add a new column to SELECT and rename it with AS.
- 3Write the same query in a slightly different way and compare results.
SQL Delete
Learn SQL Delete with a small query you can edit and run.
DELETE FROM table
WHERE condition;
Edit the SQL below and click Run. The output panel shows a table (for SELECT) or rows affected (for other statements).
SELECT *, then narrow the columns and add filters.| Line | Meaning |
|---|---|
INSERT INTO customers (customer_name, city, country) | Inserts new row(s). |
VALUES ('Temp', 'Nowhere', 'NA'); | SQL statement line. |
DELETE FROM customers WHERE customer_name = 'Temp'; | Deletes row(s). |
SELECT COUNT(*) AS customers | Selects columns/expressions. |
FROM customers; | Chooses the source table(s). |
- 1Reporting dashboards, analytics, and backend APIs read data with SQL.
- 1Forgetting a WHERE clause in UPDATE/DELETE.
- 1Start with SELECT * then narrow columns + filters.
- 1Practice the query on sample data, then apply the same pattern to real tables.
- 2Read query output carefully and verify counts when joining/grouping.
- 1Change one clause (WHERE/JOIN/GROUP BY) and predict the row count.
- 2Add a new column to SELECT and rename it with AS.
- 3Write the same query in a slightly different way and compare results.
SQL Select Top
Learn SQL Select Top with a small query you can edit and run.
SELECT columns
FROM table
WHERE condition
ORDER BY column DESC
LIMIT 10;
Edit the SQL below and click Run. The output panel shows a table (for SELECT) or rows affected (for other statements).
SELECT *, then narrow the columns and add filters.| Line | Meaning |
|---|---|
SELECT id, total_amount | Selects columns/expressions. |
FROM orders | Chooses the source table(s). |
ORDER BY total_amount DESC | Sorts the result set. |
LIMIT 2; | Limits how many rows are returned. |
- 1Reporting dashboards, analytics, and backend APIs read data with SQL.
- 1Forgetting a WHERE clause in UPDATE/DELETE.
- 1Start with SELECT * then narrow columns + filters.
- 1Practice the query on sample data, then apply the same pattern to real tables.
- 2Read query output carefully and verify counts when joining/grouping.
- 1Change one clause (WHERE/JOIN/GROUP BY) and predict the row count.
- 2Add a new column to SELECT and rename it with AS.
- 3Write the same query in a slightly different way and compare results.
SQL Aggregate Functions
Learn SQL Aggregate Functions with a small query you can edit and run.
SELECT col, COUNT(*)
FROM table
GROUP BY col
HAVING COUNT(*) > 1;
Edit the SQL below and click Run. The output panel shows a table (for SELECT) or rows affected (for other statements).
SELECT *, then narrow the columns and add filters.| Line | Meaning |
|---|---|
SELECT | SQL statement line. |
COUNT(*) AS order_count, | SQL statement line. |
MIN(total_amount) AS min_total, | SQL statement line. |
MAX(total_amount) AS max_total, | SQL statement line. |
SUM(total_amount) AS sum_total, | SQL statement line. |
AVG(total_amount) AS avg_total | SQL statement line. |
FROM orders; | Chooses the source table(s). |
- 1Counts, totals, and averages for KPIs.
- 2Finding top customers/products by revenue.
- 1Mixing non-aggregated columns without GROUP BY.
- 2Using WHERE instead of HAVING for aggregate filters.
- 1Group first, then filter aggregates with HAVING.
- 2Name aggregates with aliases (AS total_sales).
- 1Practice the query on sample data, then apply the same pattern to real tables.
- 2Read query output carefully and verify counts when joining/grouping.
- 1Change one clause (WHERE/JOIN/GROUP BY) and predict the row count.
- 2Add a new column to SELECT and rename it with AS.
- 3Write the same query in a slightly different way and compare results.
SQL Min()
Learn SQL Min() with a small query you can edit and run.
statement;
Edit the SQL below and click Run. The output panel shows a table (for SELECT) or rows affected (for other statements).
SELECT *, then narrow the columns and add filters.| Line | Meaning |
|---|---|
SELECT | SQL statement line. |
COUNT(*) AS order_count, | SQL statement line. |
MIN(total_amount) AS min_total, | SQL statement line. |
MAX(total_amount) AS max_total, | SQL statement line. |
SUM(total_amount) AS sum_total, | SQL statement line. |
AVG(total_amount) AS avg_total | SQL statement line. |
FROM orders; | Chooses the source table(s). |
- 1Reporting dashboards, analytics, and backend APIs read data with SQL.
- 1Forgetting a WHERE clause in UPDATE/DELETE.
- 1Start with SELECT * then narrow columns + filters.
- 1Practice the query on sample data, then apply the same pattern to real tables.
- 2Read query output carefully and verify counts when joining/grouping.
- 1Change one clause (WHERE/JOIN/GROUP BY) and predict the row count.
- 2Add a new column to SELECT and rename it with AS.
- 3Write the same query in a slightly different way and compare results.
SQL Max()
Learn SQL Max() with a small query you can edit and run.
statement;
Edit the SQL below and click Run. The output panel shows a table (for SELECT) or rows affected (for other statements).
SELECT *, then narrow the columns and add filters.| Line | Meaning |
|---|---|
SELECT | SQL statement line. |
COUNT(*) AS order_count, | SQL statement line. |
MIN(total_amount) AS min_total, | SQL statement line. |
MAX(total_amount) AS max_total, | SQL statement line. |
SUM(total_amount) AS sum_total, | SQL statement line. |
AVG(total_amount) AS avg_total | SQL statement line. |
FROM orders; | Chooses the source table(s). |
- 1Reporting dashboards, analytics, and backend APIs read data with SQL.
- 1Forgetting a WHERE clause in UPDATE/DELETE.
- 1Start with SELECT * then narrow columns + filters.
- 1Practice the query on sample data, then apply the same pattern to real tables.
- 2Read query output carefully and verify counts when joining/grouping.
- 1Change one clause (WHERE/JOIN/GROUP BY) and predict the row count.
- 2Add a new column to SELECT and rename it with AS.
- 3Write the same query in a slightly different way and compare results.
SQL Count()
Learn SQL Count() with a small query you can edit and run.
statement;
Edit the SQL below and click Run. The output panel shows a table (for SELECT) or rows affected (for other statements).
SELECT *, then narrow the columns and add filters.| Line | Meaning |
|---|---|
SELECT | SQL statement line. |
COUNT(*) AS order_count, | SQL statement line. |
MIN(total_amount) AS min_total, | SQL statement line. |
MAX(total_amount) AS max_total, | SQL statement line. |
SUM(total_amount) AS sum_total, | SQL statement line. |
AVG(total_amount) AS avg_total | SQL statement line. |
FROM orders; | Chooses the source table(s). |
- 1Reporting dashboards, analytics, and backend APIs read data with SQL.
- 1Forgetting a WHERE clause in UPDATE/DELETE.
- 1Start with SELECT * then narrow columns + filters.
- 1Practice the query on sample data, then apply the same pattern to real tables.
- 2Read query output carefully and verify counts when joining/grouping.
- 1Change one clause (WHERE/JOIN/GROUP BY) and predict the row count.
- 2Add a new column to SELECT and rename it with AS.
- 3Write the same query in a slightly different way and compare results.
SQL Sum()
Learn SQL Sum() with a small query you can edit and run.
statement;
Edit the SQL below and click Run. The output panel shows a table (for SELECT) or rows affected (for other statements).
SELECT *, then narrow the columns and add filters.| Line | Meaning |
|---|---|
SELECT | SQL statement line. |
COUNT(*) AS order_count, | SQL statement line. |
MIN(total_amount) AS min_total, | SQL statement line. |
MAX(total_amount) AS max_total, | SQL statement line. |
SUM(total_amount) AS sum_total, | SQL statement line. |
AVG(total_amount) AS avg_total | SQL statement line. |
FROM orders; | Chooses the source table(s). |
- 1Reporting dashboards, analytics, and backend APIs read data with SQL.
- 1Forgetting a WHERE clause in UPDATE/DELETE.
- 1Start with SELECT * then narrow columns + filters.
- 1Practice the query on sample data, then apply the same pattern to real tables.
- 2Read query output carefully and verify counts when joining/grouping.
- 1Change one clause (WHERE/JOIN/GROUP BY) and predict the row count.
- 2Add a new column to SELECT and rename it with AS.
- 3Write the same query in a slightly different way and compare results.
SQL Avg()
Learn SQL Avg() with a small query you can edit and run.
statement;
Edit the SQL below and click Run. The output panel shows a table (for SELECT) or rows affected (for other statements).
SELECT *, then narrow the columns and add filters.| Line | Meaning |
|---|---|
SELECT | SQL statement line. |
COUNT(*) AS order_count, | SQL statement line. |
MIN(total_amount) AS min_total, | SQL statement line. |
MAX(total_amount) AS max_total, | SQL statement line. |
SUM(total_amount) AS sum_total, | SQL statement line. |
AVG(total_amount) AS avg_total | SQL statement line. |
FROM orders; | Chooses the source table(s). |
- 1Reporting dashboards, analytics, and backend APIs read data with SQL.
- 1Forgetting a WHERE clause in UPDATE/DELETE.
- 1Start with SELECT * then narrow columns + filters.
- 1Practice the query on sample data, then apply the same pattern to real tables.
- 2Read query output carefully and verify counts when joining/grouping.
- 1Change one clause (WHERE/JOIN/GROUP BY) and predict the row count.
- 2Add a new column to SELECT and rename it with AS.
- 3Write the same query in a slightly different way and compare results.
SQL Like
Learn SQL Like with a small query you can edit and run.
statement;
Edit the SQL below and click Run. The output panel shows a table (for SELECT) or rows affected (for other statements).
SELECT *, then narrow the columns and add filters.| Line | Meaning |
|---|---|
SELECT customer_name | Selects columns/expressions. |
FROM customers | Chooses the source table(s). |
WHERE customer_name LIKE 'M%'; | Filters rows before grouping. |
- 1Reporting dashboards, analytics, and backend APIs read data with SQL.
- 1Forgetting a WHERE clause in UPDATE/DELETE.
- 1Start with SELECT * then narrow columns + filters.
- 1Practice the query on sample data, then apply the same pattern to real tables.
- 2Read query output carefully and verify counts when joining/grouping.
- 1Change one clause (WHERE/JOIN/GROUP BY) and predict the row count.
- 2Add a new column to SELECT and rename it with AS.
- 3Write the same query in a slightly different way and compare results.
SQL Wildcards
Learn SQL Wildcards with a small query you can edit and run.
statement;
Edit the SQL below and click Run. The output panel shows a table (for SELECT) or rows affected (for other statements).
SELECT *, then narrow the columns and add filters.| Line | Meaning |
|---|---|
SELECT customer_name | Selects columns/expressions. |
FROM customers | Chooses the source table(s). |
WHERE customer_name LIKE '_ia'; | Filters rows before grouping. |
- 1Reporting dashboards, analytics, and backend APIs read data with SQL.
- 1Forgetting a WHERE clause in UPDATE/DELETE.
- 1Start with SELECT * then narrow columns + filters.
- 1Practice the query on sample data, then apply the same pattern to real tables.
- 2Read query output carefully and verify counts when joining/grouping.
- 1Change one clause (WHERE/JOIN/GROUP BY) and predict the row count.
- 2Add a new column to SELECT and rename it with AS.
- 3Write the same query in a slightly different way and compare results.
SQL In
Learn SQL In with a small query you can edit and run.
statement;
Edit the SQL below and click Run. The output panel shows a table (for SELECT) or rows affected (for other statements).
SELECT *, then narrow the columns and add filters.| Line | Meaning |
|---|---|
SELECT customer_name, country | Selects columns/expressions. |
FROM customers | Chooses the source table(s). |
WHERE country IN ('India', 'USA'); | Filters rows before grouping. |
- 1Reporting dashboards, analytics, and backend APIs read data with SQL.
- 1Forgetting a WHERE clause in UPDATE/DELETE.
- 1Start with SELECT * then narrow columns + filters.
- 1Practice the query on sample data, then apply the same pattern to real tables.
- 2Read query output carefully and verify counts when joining/grouping.
- 1Change one clause (WHERE/JOIN/GROUP BY) and predict the row count.
- 2Add a new column to SELECT and rename it with AS.
- 3Write the same query in a slightly different way and compare results.
SQL Between
Learn SQL Between with a small query you can edit and run.
statement;
Edit the SQL below and click Run. The output panel shows a table (for SELECT) or rows affected (for other statements).
SELECT *, then narrow the columns and add filters.| Line | Meaning |
|---|---|
SELECT id, total_amount | Selects columns/expressions. |
FROM orders | Chooses the source table(s). |
WHERE total_amount BETWEEN 100 AND 1000 | Filters rows before grouping. |
ORDER BY total_amount DESC; | Sorts the result set. |
- 1Reporting dashboards, analytics, and backend APIs read data with SQL.
- 1Forgetting a WHERE clause in UPDATE/DELETE.
- 1Start with SELECT * then narrow columns + filters.
- 1Practice the query on sample data, then apply the same pattern to real tables.
- 2Read query output carefully and verify counts when joining/grouping.
- 1Change one clause (WHERE/JOIN/GROUP BY) and predict the row count.
- 2Add a new column to SELECT and rename it with AS.
- 3Write the same query in a slightly different way and compare results.
SQL Aliases
Learn SQL Aliases with a small query you can edit and run.
statement;
Edit the SQL below and click Run. The output panel shows a table (for SELECT) or rows affected (for other statements).
SELECT *, then narrow the columns and add filters.| Line | Meaning |
|---|---|
SELECT customer_name AS name, country AS c | Selects columns/expressions. |
FROM customers | Chooses the source table(s). |
ORDER BY name; | Sorts the result set. |
- 1Reporting dashboards, analytics, and backend APIs read data with SQL.
- 1Forgetting a WHERE clause in UPDATE/DELETE.
- 1Start with SELECT * then narrow columns + filters.
- 1Practice the query on sample data, then apply the same pattern to real tables.
- 2Read query output carefully and verify counts when joining/grouping.
- 1Change one clause (WHERE/JOIN/GROUP BY) and predict the row count.
- 2Add a new column to SELECT and rename it with AS.
- 3Write the same query in a slightly different way and compare results.
SQL Joins
Learn SQL Joins with a small query you can edit and run.
SELECT a.col, b.col
FROM a
JOIN b ON b.a_id = a.id;
Edit the SQL below and click Run. The output panel shows a table (for SELECT) or rows affected (for other statements).
SELECT *, then narrow the columns and add filters.| Line | Meaning |
|---|---|
SELECT o.id AS order_id, c.customer_name, o.total_amount | Selects columns/expressions. |
FROM orders o | Chooses the source table(s). |
JOIN customers c ON c.id = o.customer_id | Combines rows from related tables. |
ORDER BY o.total_amount DESC; | Sorts the result set. |
- 1Combine customer + order data for reports.
- 2Enrich rows by joining lookup tables (products, departments).
- 1Joining on the wrong key and duplicating rows.
- 2Using SELECT * with joins and getting ambiguous columns.
- 1Always join on the correct primary/foreign key.
- 2Alias tables (`c`, `o`) and select only needed columns.
- 1Practice the query on sample data, then apply the same pattern to real tables.
- 2Read query output carefully and verify counts when joining/grouping.
- 1Change one clause (WHERE/JOIN/GROUP BY) and predict the row count.
- 2Add a new column to SELECT and rename it with AS.
- 3Write the same query in a slightly different way and compare results.
SQL Inner Join
Learn SQL Inner Join with a small query you can edit and run.
SELECT a.col, b.col
FROM a
JOIN b ON b.a_id = a.id;
Edit the SQL below and click Run. The output panel shows a table (for SELECT) or rows affected (for other statements).
SELECT *, then narrow the columns and add filters.| Line | Meaning |
|---|---|
SELECT o.id AS order_id, c.customer_name, o.total_amount | Selects columns/expressions. |
FROM orders o | Chooses the source table(s). |
JOIN customers c ON c.id = o.customer_id | Combines rows from related tables. |
ORDER BY o.total_amount DESC; | Sorts the result set. |
- 1Combine customer + order data for reports.
- 2Enrich rows by joining lookup tables (products, departments).
- 1Joining on the wrong key and duplicating rows.
- 2Using SELECT * with joins and getting ambiguous columns.
- 1Always join on the correct primary/foreign key.
- 2Alias tables (`c`, `o`) and select only needed columns.
- 1Practice the query on sample data, then apply the same pattern to real tables.
- 2Read query output carefully and verify counts when joining/grouping.
- 1Change one clause (WHERE/JOIN/GROUP BY) and predict the row count.
- 2Add a new column to SELECT and rename it with AS.
- 3Write the same query in a slightly different way and compare results.
SQL Left Join
Learn SQL Left Join with a small query you can edit and run.
SELECT a.col, b.col
FROM a
JOIN b ON b.a_id = a.id;
Edit the SQL below and click Run. The output panel shows a table (for SELECT) or rows affected (for other statements).
SELECT *, then narrow the columns and add filters.| Line | Meaning |
|---|---|
SELECT o.id AS order_id, c.customer_name, o.total_amount | Selects columns/expressions. |
FROM orders o | Chooses the source table(s). |
JOIN customers c ON c.id = o.customer_id | Combines rows from related tables. |
ORDER BY o.total_amount DESC; | Sorts the result set. |
- 1Combine customer + order data for reports.
- 2Enrich rows by joining lookup tables (products, departments).
- 1Joining on the wrong key and duplicating rows.
- 2Using SELECT * with joins and getting ambiguous columns.
- 1Always join on the correct primary/foreign key.
- 2Alias tables (`c`, `o`) and select only needed columns.
- 1Practice the query on sample data, then apply the same pattern to real tables.
- 2Read query output carefully and verify counts when joining/grouping.
- 1Change one clause (WHERE/JOIN/GROUP BY) and predict the row count.
- 2Add a new column to SELECT and rename it with AS.
- 3Write the same query in a slightly different way and compare results.
SQL Right Join
Learn SQL Right Join with a small query you can edit and run.
SELECT a.col, b.col
FROM a
JOIN b ON b.a_id = a.id;
Edit the SQL below and click Run. The output panel shows a table (for SELECT) or rows affected (for other statements).
SELECT *, then narrow the columns and add filters.| Line | Meaning |
|---|---|
SELECT o.id AS order_id, c.customer_name, o.total_amount | Selects columns/expressions. |
FROM orders o | Chooses the source table(s). |
JOIN customers c ON c.id = o.customer_id | Combines rows from related tables. |
ORDER BY o.total_amount DESC; | Sorts the result set. |
- 1Combine customer + order data for reports.
- 2Enrich rows by joining lookup tables (products, departments).
- 1Joining on the wrong key and duplicating rows.
- 2Using SELECT * with joins and getting ambiguous columns.
- 1Always join on the correct primary/foreign key.
- 2Alias tables (`c`, `o`) and select only needed columns.
- 1Practice the query on sample data, then apply the same pattern to real tables.
- 2Read query output carefully and verify counts when joining/grouping.
- 1Change one clause (WHERE/JOIN/GROUP BY) and predict the row count.
- 2Add a new column to SELECT and rename it with AS.
- 3Write the same query in a slightly different way and compare results.
SQL Full Join
Learn SQL Full Join with a small query you can edit and run.
SELECT a.col, b.col
FROM a
JOIN b ON b.a_id = a.id;
Edit the SQL below and click Run. The output panel shows a table (for SELECT) or rows affected (for other statements).
SELECT *, then narrow the columns and add filters.| Line | Meaning |
|---|---|
SELECT o.id AS order_id, c.customer_name, o.total_amount | Selects columns/expressions. |
FROM orders o | Chooses the source table(s). |
JOIN customers c ON c.id = o.customer_id | Combines rows from related tables. |
ORDER BY o.total_amount DESC; | Sorts the result set. |
- 1Combine customer + order data for reports.
- 2Enrich rows by joining lookup tables (products, departments).
- 1Joining on the wrong key and duplicating rows.
- 2Using SELECT * with joins and getting ambiguous columns.
- 1Always join on the correct primary/foreign key.
- 2Alias tables (`c`, `o`) and select only needed columns.
- 1Practice the query on sample data, then apply the same pattern to real tables.
- 2Read query output carefully and verify counts when joining/grouping.
- 1Change one clause (WHERE/JOIN/GROUP BY) and predict the row count.
- 2Add a new column to SELECT and rename it with AS.
- 3Write the same query in a slightly different way and compare results.
SQL Self Join
Learn SQL Self Join with a small query you can edit and run.
SELECT a.col, b.col
FROM a
JOIN b ON b.a_id = a.id;
Edit the SQL below and click Run. The output panel shows a table (for SELECT) or rows affected (for other statements).
SELECT *, then narrow the columns and add filters.| Line | Meaning |
|---|---|
SELECT o.id AS order_id, c.customer_name, o.total_amount | Selects columns/expressions. |
FROM orders o | Chooses the source table(s). |
JOIN customers c ON c.id = o.customer_id | Combines rows from related tables. |
ORDER BY o.total_amount DESC; | Sorts the result set. |
- 1Combine customer + order data for reports.
- 2Enrich rows by joining lookup tables (products, departments).
- 1Joining on the wrong key and duplicating rows.
- 2Using SELECT * with joins and getting ambiguous columns.
- 1Always join on the correct primary/foreign key.
- 2Alias tables (`c`, `o`) and select only needed columns.
- 1Practice the query on sample data, then apply the same pattern to real tables.
- 2Read query output carefully and verify counts when joining/grouping.
- 1Change one clause (WHERE/JOIN/GROUP BY) and predict the row count.
- 2Add a new column to SELECT and rename it with AS.
- 3Write the same query in a slightly different way and compare results.
SQL Union
Learn SQL Union with a small query you can edit and run.
statement;
Edit the SQL below and click Run. The output panel shows a table (for SELECT) or rows affected (for other statements).
SELECT *, then narrow the columns and add filters.| Line | Meaning |
|---|---|
SELECT country AS label FROM customers | Selects columns/expressions. |
UNION | SQL statement line. |
SELECT department AS label FROM employees; | Selects columns/expressions. |
- 1Reporting dashboards, analytics, and backend APIs read data with SQL.
- 1Forgetting a WHERE clause in UPDATE/DELETE.
- 1Start with SELECT * then narrow columns + filters.
- 1Practice the query on sample data, then apply the same pattern to real tables.
- 2Read query output carefully and verify counts when joining/grouping.
- 1Change one clause (WHERE/JOIN/GROUP BY) and predict the row count.
- 2Add a new column to SELECT and rename it with AS.
- 3Write the same query in a slightly different way and compare results.
SQL Union All
Learn SQL Union All with a small query you can edit and run.
statement;
Edit the SQL below and click Run. The output panel shows a table (for SELECT) or rows affected (for other statements).
SELECT *, then narrow the columns and add filters.| Line | Meaning |
|---|---|
SELECT country AS label FROM customers | Selects columns/expressions. |
UNION | SQL statement line. |
SELECT department AS label FROM employees; | Selects columns/expressions. |
- 1Reporting dashboards, analytics, and backend APIs read data with SQL.
- 1Forgetting a WHERE clause in UPDATE/DELETE.
- 1Start with SELECT * then narrow columns + filters.
- 1Practice the query on sample data, then apply the same pattern to real tables.
- 2Read query output carefully and verify counts when joining/grouping.
- 1Change one clause (WHERE/JOIN/GROUP BY) and predict the row count.
- 2Add a new column to SELECT and rename it with AS.
- 3Write the same query in a slightly different way and compare results.
SQL Group By
Learn SQL Group By with a small query you can edit and run.
SELECT col, COUNT(*)
FROM table
GROUP BY col
HAVING COUNT(*) > 1;
Edit the SQL below and click Run. The output panel shows a table (for SELECT) or rows affected (for other statements).
SELECT *, then narrow the columns and add filters.| Line | Meaning |
|---|---|
SELECT country, COUNT(*) AS customers | Selects columns/expressions. |
FROM customers | Chooses the source table(s). |
GROUP BY country | Groups rows for aggregation. |
ORDER BY customers DESC; | Sorts the result set. |
- 1Counts, totals, and averages for KPIs.
- 2Finding top customers/products by revenue.
- 1Mixing non-aggregated columns without GROUP BY.
- 2Using WHERE instead of HAVING for aggregate filters.
- 1Group first, then filter aggregates with HAVING.
- 2Name aggregates with aliases (AS total_sales).
- 1Practice the query on sample data, then apply the same pattern to real tables.
- 2Read query output carefully and verify counts when joining/grouping.
- 1Change one clause (WHERE/JOIN/GROUP BY) and predict the row count.
- 2Add a new column to SELECT and rename it with AS.
- 3Write the same query in a slightly different way and compare results.
SQL Having
Learn SQL Having with a small query you can edit and run.
statement;
Edit the SQL below and click Run. The output panel shows a table (for SELECT) or rows affected (for other statements).
SELECT *, then narrow the columns and add filters.| Line | Meaning |
|---|---|
SELECT customer_id, COUNT(*) AS orders | Selects columns/expressions. |
FROM orders | Chooses the source table(s). |
GROUP BY customer_id | Groups rows for aggregation. |
HAVING COUNT(*) >= 2; | Filters groups after aggregation. |
- 1Counts, totals, and averages for KPIs.
- 2Finding top customers/products by revenue.
- 1Mixing non-aggregated columns without GROUP BY.
- 2Using WHERE instead of HAVING for aggregate filters.
- 1Group first, then filter aggregates with HAVING.
- 2Name aggregates with aliases (AS total_sales).
- 1Practice the query on sample data, then apply the same pattern to real tables.
- 2Read query output carefully and verify counts when joining/grouping.
- 1Change one clause (WHERE/JOIN/GROUP BY) and predict the row count.
- 2Add a new column to SELECT and rename it with AS.
- 3Write the same query in a slightly different way and compare results.
SQL Exists
Learn SQL Exists with a small query you can edit and run.
statement;
Edit the SQL below and click Run. The output panel shows a table (for SELECT) or rows affected (for other statements).
SELECT *, then narrow the columns and add filters.| Line | Meaning |
|---|---|
SELECT customer_name | Selects columns/expressions. |
FROM customers c | Chooses the source table(s). |
WHERE EXISTS ( | Filters rows before grouping. |
SELECT 1 FROM orders o WHERE o.customer_id = c.id | Selects columns/expressions. |
); | SQL statement line. |
- 1Reporting dashboards, analytics, and backend APIs read data with SQL.
- 1Forgetting a WHERE clause in UPDATE/DELETE.
- 1Start with SELECT * then narrow columns + filters.
- 1Practice the query on sample data, then apply the same pattern to real tables.
- 2Read query output carefully and verify counts when joining/grouping.
- 1Change one clause (WHERE/JOIN/GROUP BY) and predict the row count.
- 2Add a new column to SELECT and rename it with AS.
- 3Write the same query in a slightly different way and compare results.
SQL Any
Learn SQL Any with a small query you can edit and run.
statement;
Edit the SQL below and click Run. The output panel shows a table (for SELECT) or rows affected (for other statements).
SELECT *, then narrow the columns and add filters.| Line | Meaning |
|---|---|
SELECT id, total_amount | Selects columns/expressions. |
FROM orders | Chooses the source table(s). |
WHERE total_amount > (SELECT AVG(total_amount) FROM orders); | Filters rows before grouping. |
- 1Reporting dashboards, analytics, and backend APIs read data with SQL.
- 1Forgetting a WHERE clause in UPDATE/DELETE.
- 1Start with SELECT * then narrow columns + filters.
- 1Practice the query on sample data, then apply the same pattern to real tables.
- 2Read query output carefully and verify counts when joining/grouping.
- 1Change one clause (WHERE/JOIN/GROUP BY) and predict the row count.
- 2Add a new column to SELECT and rename it with AS.
- 3Write the same query in a slightly different way and compare results.
SQL All
Learn SQL All with a small query you can edit and run.
statement;
Edit the SQL below and click Run. The output panel shows a table (for SELECT) or rows affected (for other statements).
SELECT *, then narrow the columns and add filters.| Line | Meaning |
|---|---|
SELECT id, total_amount | Selects columns/expressions. |
FROM orders | Chooses the source table(s). |
WHERE total_amount > (SELECT AVG(total_amount) FROM orders); | Filters rows before grouping. |
- 1Reporting dashboards, analytics, and backend APIs read data with SQL.
- 1Forgetting a WHERE clause in UPDATE/DELETE.
- 1Start with SELECT * then narrow columns + filters.
- 1Practice the query on sample data, then apply the same pattern to real tables.
- 2Read query output carefully and verify counts when joining/grouping.
- 1Change one clause (WHERE/JOIN/GROUP BY) and predict the row count.
- 2Add a new column to SELECT and rename it with AS.
- 3Write the same query in a slightly different way and compare results.
SQL Select Into
Learn SQL Select Into with a small query you can edit and run.
statement;
Edit the SQL below and click Run. The output panel shows a table (for SELECT) or rows affected (for other statements).
SELECT *, then narrow the columns and add filters.| Line | Meaning |
|---|---|
CREATE TABLE high_value_orders AS | Creates a database object (table/view/index). |
SELECT * FROM orders WHERE total_amount > 500; | Selects columns/expressions. |
SELECT COUNT(*) AS rows_in_new_table FROM high_value_orders; | Selects columns/expressions. |
- 1Reporting dashboards, analytics, and backend APIs read data with SQL.
- 1Forgetting a WHERE clause in UPDATE/DELETE.
- 1Start with SELECT * then narrow columns + filters.
- 1Practice the query on sample data, then apply the same pattern to real tables.
- 2Read query output carefully and verify counts when joining/grouping.
- 1Change one clause (WHERE/JOIN/GROUP BY) and predict the row count.
- 2Add a new column to SELECT and rename it with AS.
- 3Write the same query in a slightly different way and compare results.
SQL Insert Into Select
Learn SQL Insert Into Select with a small query you can edit and run.
INSERT INTO table (col1, col2)
VALUES (val1, val2);
Edit the SQL below and click Run. The output panel shows a table (for SELECT) or rows affected (for other statements).
SELECT *, then narrow the columns and add filters.| Line | Meaning |
|---|---|
INSERT INTO customers (customer_name, city, country) | Inserts new row(s). |
VALUES ('Zara', 'Dubai', 'UAE'); | SQL statement line. |
SELECT customer_name, country | Selects columns/expressions. |
FROM customers | Chooses the source table(s). |
ORDER BY id DESC | Sorts the result set. |
LIMIT 3; | Limits how many rows are returned. |
- 1Reporting dashboards, analytics, and backend APIs read data with SQL.
- 1Forgetting a WHERE clause in UPDATE/DELETE.
- 1Start with SELECT * then narrow columns + filters.
- 1Practice the query on sample data, then apply the same pattern to real tables.
- 2Read query output carefully and verify counts when joining/grouping.
- 1Change one clause (WHERE/JOIN/GROUP BY) and predict the row count.
- 2Add a new column to SELECT and rename it with AS.
- 3Write the same query in a slightly different way and compare results.
SQL Case
Learn SQL Case with a small query you can edit and run.
SELECT col,
CASE WHEN col > 0 THEN 'pos' ELSE 'non-pos' END AS label
FROM table;
Edit the SQL below and click Run. The output panel shows a table (for SELECT) or rows affected (for other statements).
SELECT *, then narrow the columns and add filters.| Line | Meaning |
|---|---|
SELECT id, total_amount, | Selects columns/expressions. |
CASE | SQL statement line. |
WHEN total_amount >= 1000 THEN 'high' | SQL statement line. |
WHEN total_amount >= 200 THEN 'medium' | SQL statement line. |
ELSE 'low' | SQL statement line. |
END AS bucket | SQL statement line. |
FROM orders | Chooses the source table(s). |
ORDER BY total_amount DESC; | Sorts the result set. |
- 1Reporting dashboards, analytics, and backend APIs read data with SQL.
- 1Forgetting a WHERE clause in UPDATE/DELETE.
- 1Start with SELECT * then narrow columns + filters.
- 1Practice the query on sample data, then apply the same pattern to real tables.
- 2Read query output carefully and verify counts when joining/grouping.
- 1Change one clause (WHERE/JOIN/GROUP BY) and predict the row count.
- 2Add a new column to SELECT and rename it with AS.
- 3Write the same query in a slightly different way and compare results.
SQL Null Functions
Learn SQL Null Functions with a small query you can edit and run.
statement;
Edit the SQL below and click Run. The output panel shows a table (for SELECT) or rows affected (for other statements).
SELECT *, then narrow the columns and add filters.| Line | Meaning |
|---|---|
SELECT customer_name, COALESCE(city, 'Unknown') AS city | Selects columns/expressions. |
FROM customers | Chooses the source table(s). |
ORDER BY customer_name; | Sorts the result set. |
- 1Reporting dashboards, analytics, and backend APIs read data with SQL.
- 1Forgetting a WHERE clause in UPDATE/DELETE.
- 1Start with SELECT * then narrow columns + filters.
- 1Practice the query on sample data, then apply the same pattern to real tables.
- 2Read query output carefully and verify counts when joining/grouping.
- 1Change one clause (WHERE/JOIN/GROUP BY) and predict the row count.
- 2Add a new column to SELECT and rename it with AS.
- 3Write the same query in a slightly different way and compare results.
SQL Stored Procedures
Learn SQL Stored Procedures with a small query you can edit and run.
statement;
Edit the SQL below and click Run. The output panel shows a table (for SELECT) or rows affected (for other statements).
SELECT *, then narrow the columns and add filters.| Line | Meaning |
|---|---|
SELECT 'Stored procedures demo (read note)' AS info; | Selects columns/expressions. |
- 1Reporting dashboards, analytics, and backend APIs read data with SQL.
- 1Forgetting a WHERE clause in UPDATE/DELETE.
- 1Start with SELECT * then narrow columns + filters.
- 1Practice the query on sample data, then apply the same pattern to real tables.
- 2Read query output carefully and verify counts when joining/grouping.
- 1Change one clause (WHERE/JOIN/GROUP BY) and predict the row count.
- 2Add a new column to SELECT and rename it with AS.
- 3Write the same query in a slightly different way and compare results.
SQL Comments
Learn SQL Comments with a small query you can edit and run.
-- single line
/* multi line */
Edit the SQL below and click Run. The output panel shows a table (for SELECT) or rows affected (for other statements).
SELECT *, then narrow the columns and add filters.| Line | Meaning |
|---|---|
/* Multi-line | SQL statement line. |
comment */ | SQL statement line. |
SELECT 1 AS one; | Selects columns/expressions. |
- 1Reporting dashboards, analytics, and backend APIs read data with SQL.
- 1Forgetting a WHERE clause in UPDATE/DELETE.
- 1Start with SELECT * then narrow columns + filters.
- 1Practice the query on sample data, then apply the same pattern to real tables.
- 2Read query output carefully and verify counts when joining/grouping.
- 1Change one clause (WHERE/JOIN/GROUP BY) and predict the row count.
- 2Add a new column to SELECT and rename it with AS.
- 3Write the same query in a slightly different way and compare results.
SQL Operators
Learn SQL Operators with a small query you can edit and run.
statement;
Edit the SQL below and click Run. The output panel shows a table (for SELECT) or rows affected (for other statements).
SELECT *, then narrow the columns and add filters.| Line | Meaning |
|---|---|
SELECT 7 + 3 AS add, 7 * 3 AS mul, 7 > 3 AS is_greater; | Selects columns/expressions. |
- 1Reporting dashboards, analytics, and backend APIs read data with SQL.
- 1Forgetting a WHERE clause in UPDATE/DELETE.
- 1Start with SELECT * then narrow columns + filters.
- 1Practice the query on sample data, then apply the same pattern to real tables.
- 2Read query output carefully and verify counts when joining/grouping.
- 1Change one clause (WHERE/JOIN/GROUP BY) and predict the row count.
- 2Add a new column to SELECT and rename it with AS.
- 3Write the same query in a slightly different way and compare results.
SQL Database
Learn SQL Database with a small query you can edit and run.
statement;
Edit the SQL below and click Run. The output panel shows a table (for SELECT) or rows affected (for other statements).
SELECT *, then narrow the columns and add filters.| Line | Meaning |
|---|---|
SELECT 1 AS example; | Selects columns/expressions. |
- 1Reporting dashboards, analytics, and backend APIs read data with SQL.
- 1Forgetting a WHERE clause in UPDATE/DELETE.
- 1Start with SELECT * then narrow columns + filters.
- 1Practice the query on sample data, then apply the same pattern to real tables.
- 2Read query output carefully and verify counts when joining/grouping.
- 1Change one clause (WHERE/JOIN/GROUP BY) and predict the row count.
- 2Add a new column to SELECT and rename it with AS.
- 3Write the same query in a slightly different way and compare results.
SQL Create DB
Learn SQL Create DB with a small query you can edit and run.
statement;
Edit the SQL below and click Run. The output panel shows a table (for SELECT) or rows affected (for other statements).
SELECT *, then narrow the columns and add filters.| Line | Meaning |
|---|---|
SELECT 'Read the explanation for this topic.' AS note; | Selects columns/expressions. |
- 1Design tables with correct keys and constraints.
- 2Evolve schema with migrations.
- 1Changing schema directly in production without a migration plan.
- 2Missing indexes on lookup/join columns.
- 1Use migrations + backups.
- 2Add constraints to enforce data integrity.
- 1Practice the query on sample data, then apply the same pattern to real tables.
- 2Read query output carefully and verify counts when joining/grouping.
- 1Change one clause (WHERE/JOIN/GROUP BY) and predict the row count.
- 2Add a new column to SELECT and rename it with AS.
- 3Write the same query in a slightly different way and compare results.
SQL Drop DB
Learn SQL Drop DB with a small query you can edit and run.
statement;
Edit the SQL below and click Run. The output panel shows a table (for SELECT) or rows affected (for other statements).
SELECT *, then narrow the columns and add filters.| Line | Meaning |
|---|---|
SELECT 'Read the explanation for this topic.' AS note; | Selects columns/expressions. |
- 1Design tables with correct keys and constraints.
- 2Evolve schema with migrations.
- 1Changing schema directly in production without a migration plan.
- 2Missing indexes on lookup/join columns.
- 1Use migrations + backups.
- 2Add constraints to enforce data integrity.
- 1Practice the query on sample data, then apply the same pattern to real tables.
- 2Read query output carefully and verify counts when joining/grouping.
- 1Change one clause (WHERE/JOIN/GROUP BY) and predict the row count.
- 2Add a new column to SELECT and rename it with AS.
- 3Write the same query in a slightly different way and compare results.
SQL Backup DB
Learn SQL Backup DB with a small query you can edit and run.
statement;
Edit the SQL below and click Run. The output panel shows a table (for SELECT) or rows affected (for other statements).
SELECT *, then narrow the columns and add filters.| Line | Meaning |
|---|---|
SELECT 'Read the explanation for this topic.' AS note; | Selects columns/expressions. |
- 1Reporting dashboards, analytics, and backend APIs read data with SQL.
- 1Forgetting a WHERE clause in UPDATE/DELETE.
- 1Start with SELECT * then narrow columns + filters.
- 1Practice the query on sample data, then apply the same pattern to real tables.
- 2Read query output carefully and verify counts when joining/grouping.
- 1Change one clause (WHERE/JOIN/GROUP BY) and predict the row count.
- 2Add a new column to SELECT and rename it with AS.
- 3Write the same query in a slightly different way and compare results.
SQL Create Table
Learn SQL Create Table with a small query you can edit and run.
CREATE TABLE table (
id INTEGER PRIMARY KEY,
name TEXT NOT NULL
);
Edit the SQL below and click Run. The output panel shows a table (for SELECT) or rows affected (for other statements).
SELECT *, then narrow the columns and add filters.| Line | Meaning |
|---|---|
CREATE TABLE students ( | Creates a database object (table/view/index). |
id INTEGER PRIMARY KEY AUTOINCREMENT, | SQL statement line. |
name TEXT NOT NULL, | SQL statement line. |
marks INTEGER | SQL statement line. |
); | SQL statement line. |
INSERT INTO students (name, marks) VALUES ('Mia', 88), ('Noah', 72); | Inserts new row(s). |
SELECT * FROM students; | Selects columns/expressions. |
- 1Design tables with correct keys and constraints.
- 2Evolve schema with migrations.
- 1Changing schema directly in production without a migration plan.
- 2Missing indexes on lookup/join columns.
- 1Use migrations + backups.
- 2Add constraints to enforce data integrity.
- 1Practice the query on sample data, then apply the same pattern to real tables.
- 2Read query output carefully and verify counts when joining/grouping.
- 1Change one clause (WHERE/JOIN/GROUP BY) and predict the row count.
- 2Add a new column to SELECT and rename it with AS.
- 3Write the same query in a slightly different way and compare results.
SQL Drop Table
Learn SQL Drop Table with a small query you can edit and run.
statement;
Edit the SQL below and click Run. The output panel shows a table (for SELECT) or rows affected (for other statements).
SELECT *, then narrow the columns and add filters.| Line | Meaning |
|---|---|
CREATE TABLE tmp_table (id INTEGER); | Creates a database object (table/view/index). |
DROP TABLE tmp_table; | Removes a database object. |
SELECT 'dropped tmp_table' AS status; | Selects columns/expressions. |
- 1Design tables with correct keys and constraints.
- 2Evolve schema with migrations.
- 1Changing schema directly in production without a migration plan.
- 2Missing indexes on lookup/join columns.
- 1Use migrations + backups.
- 2Add constraints to enforce data integrity.
- 1Practice the query on sample data, then apply the same pattern to real tables.
- 2Read query output carefully and verify counts when joining/grouping.
- 1Change one clause (WHERE/JOIN/GROUP BY) and predict the row count.
- 2Add a new column to SELECT and rename it with AS.
- 3Write the same query in a slightly different way and compare results.
SQL Alter Table
Learn SQL Alter Table with a small query you can edit and run.
ALTER TABLE table ADD COLUMN new_col TEXT;
Edit the SQL below and click Run. The output panel shows a table (for SELECT) or rows affected (for other statements).
SELECT *, then narrow the columns and add filters.| Line | Meaning |
|---|---|
CREATE TABLE demo (id INTEGER); | Creates a database object (table/view/index). |
ALTER TABLE demo ADD COLUMN name TEXT; | Changes a table definition. |
PRAGMA table_info(demo); | SQL statement line. |
- 1Design tables with correct keys and constraints.
- 2Evolve schema with migrations.
- 1Changing schema directly in production without a migration plan.
- 2Missing indexes on lookup/join columns.
- 1Use migrations + backups.
- 2Add constraints to enforce data integrity.
- 1Practice the query on sample data, then apply the same pattern to real tables.
- 2Read query output carefully and verify counts when joining/grouping.
- 1Change one clause (WHERE/JOIN/GROUP BY) and predict the row count.
- 2Add a new column to SELECT and rename it with AS.
- 3Write the same query in a slightly different way and compare results.
SQL Constraints
Learn SQL Constraints with a small query you can edit and run.
statement;
Edit the SQL below and click Run. The output panel shows a table (for SELECT) or rows affected (for other statements).
SELECT *, then narrow the columns and add filters.| Line | Meaning |
|---|---|
CREATE TABLE demo_users ( | Creates a database object (table/view/index). |
id INTEGER PRIMARY KEY AUTOINCREMENT, | SQL statement line. |
name TEXT NOT NULL, | SQL statement line. |
role TEXT NOT NULL DEFAULT 'user' | SQL statement line. |
); | SQL statement line. |
INSERT INTO demo_users (name) VALUES ('Aarav'); | Inserts new row(s). |
SELECT * FROM demo_users; | Selects columns/expressions. |
- 1Design tables with correct keys and constraints.
- 2Evolve schema with migrations.
- 1Changing schema directly in production without a migration plan.
- 2Missing indexes on lookup/join columns.
- 1Use migrations + backups.
- 2Add constraints to enforce data integrity.
- 1Practice the query on sample data, then apply the same pattern to real tables.
- 2Read query output carefully and verify counts when joining/grouping.
- 1Change one clause (WHERE/JOIN/GROUP BY) and predict the row count.
- 2Add a new column to SELECT and rename it with AS.
- 3Write the same query in a slightly different way and compare results.
SQL Not Null
Learn SQL Not Null with a small query you can edit and run.
statement;
Edit the SQL below and click Run. The output panel shows a table (for SELECT) or rows affected (for other statements).
SELECT *, then narrow the columns and add filters.| Line | Meaning |
|---|---|
CREATE TABLE demo_users ( | Creates a database object (table/view/index). |
id INTEGER PRIMARY KEY AUTOINCREMENT, | SQL statement line. |
name TEXT NOT NULL, | SQL statement line. |
role TEXT NOT NULL DEFAULT 'user' | SQL statement line. |
); | SQL statement line. |
INSERT INTO demo_users (name) VALUES ('Aarav'); | Inserts new row(s). |
SELECT * FROM demo_users; | Selects columns/expressions. |
- 1Reporting dashboards, analytics, and backend APIs read data with SQL.
- 1Forgetting a WHERE clause in UPDATE/DELETE.
- 1Start with SELECT * then narrow columns + filters.
- 1Practice the query on sample data, then apply the same pattern to real tables.
- 2Read query output carefully and verify counts when joining/grouping.
- 1Change one clause (WHERE/JOIN/GROUP BY) and predict the row count.
- 2Add a new column to SELECT and rename it with AS.
- 3Write the same query in a slightly different way and compare results.
SQL Unique
Learn SQL Unique with a small query you can edit and run.
statement;
Edit the SQL below and click Run. The output panel shows a table (for SELECT) or rows affected (for other statements).
SELECT *, then narrow the columns and add filters.| Line | Meaning |
|---|---|
CREATE TABLE demo_users ( | Creates a database object (table/view/index). |
id INTEGER PRIMARY KEY AUTOINCREMENT, | SQL statement line. |
name TEXT NOT NULL, | SQL statement line. |
role TEXT NOT NULL DEFAULT 'user' | SQL statement line. |
); | SQL statement line. |
INSERT INTO demo_users (name) VALUES ('Aarav'); | Inserts new row(s). |
SELECT * FROM demo_users; | Selects columns/expressions. |
- 1Reporting dashboards, analytics, and backend APIs read data with SQL.
- 1Forgetting a WHERE clause in UPDATE/DELETE.
- 1Start with SELECT * then narrow columns + filters.
- 1Practice the query on sample data, then apply the same pattern to real tables.
- 2Read query output carefully and verify counts when joining/grouping.
- 1Change one clause (WHERE/JOIN/GROUP BY) and predict the row count.
- 2Add a new column to SELECT and rename it with AS.
- 3Write the same query in a slightly different way and compare results.
SQL Primary Key
Learn SQL Primary Key with a small query you can edit and run.
statement;
Edit the SQL below and click Run. The output panel shows a table (for SELECT) or rows affected (for other statements).
SELECT *, then narrow the columns and add filters.| Line | Meaning |
|---|---|
CREATE TABLE demo_users ( | Creates a database object (table/view/index). |
id INTEGER PRIMARY KEY AUTOINCREMENT, | SQL statement line. |
name TEXT NOT NULL, | SQL statement line. |
role TEXT NOT NULL DEFAULT 'user' | SQL statement line. |
); | SQL statement line. |
INSERT INTO demo_users (name) VALUES ('Aarav'); | Inserts new row(s). |
SELECT * FROM demo_users; | Selects columns/expressions. |
- 1Reporting dashboards, analytics, and backend APIs read data with SQL.
- 1Forgetting a WHERE clause in UPDATE/DELETE.
- 1Start with SELECT * then narrow columns + filters.
- 1Practice the query on sample data, then apply the same pattern to real tables.
- 2Read query output carefully and verify counts when joining/grouping.
- 1Change one clause (WHERE/JOIN/GROUP BY) and predict the row count.
- 2Add a new column to SELECT and rename it with AS.
- 3Write the same query in a slightly different way and compare results.
SQL Foreign Key
Learn SQL Foreign Key with a small query you can edit and run.
statement;
Edit the SQL below and click Run. The output panel shows a table (for SELECT) or rows affected (for other statements).
SELECT *, then narrow the columns and add filters.| Line | Meaning |
|---|---|
CREATE TABLE demo_users ( | Creates a database object (table/view/index). |
id INTEGER PRIMARY KEY AUTOINCREMENT, | SQL statement line. |
name TEXT NOT NULL, | SQL statement line. |
role TEXT NOT NULL DEFAULT 'user' | SQL statement line. |
); | SQL statement line. |
INSERT INTO demo_users (name) VALUES ('Aarav'); | Inserts new row(s). |
SELECT * FROM demo_users; | Selects columns/expressions. |
- 1Reporting dashboards, analytics, and backend APIs read data with SQL.
- 1Forgetting a WHERE clause in UPDATE/DELETE.
- 1Start with SELECT * then narrow columns + filters.
- 1Practice the query on sample data, then apply the same pattern to real tables.
- 2Read query output carefully and verify counts when joining/grouping.
- 1Change one clause (WHERE/JOIN/GROUP BY) and predict the row count.
- 2Add a new column to SELECT and rename it with AS.
- 3Write the same query in a slightly different way and compare results.
SQL Check
Learn SQL Check with a small query you can edit and run.
statement;
Edit the SQL below and click Run. The output panel shows a table (for SELECT) or rows affected (for other statements).
SELECT *, then narrow the columns and add filters.| Line | Meaning |
|---|---|
CREATE TABLE demo_users ( | Creates a database object (table/view/index). |
id INTEGER PRIMARY KEY AUTOINCREMENT, | SQL statement line. |
name TEXT NOT NULL, | SQL statement line. |
role TEXT NOT NULL DEFAULT 'user' | SQL statement line. |
); | SQL statement line. |
INSERT INTO demo_users (name) VALUES ('Aarav'); | Inserts new row(s). |
SELECT * FROM demo_users; | Selects columns/expressions. |
- 1Reporting dashboards, analytics, and backend APIs read data with SQL.
- 1Forgetting a WHERE clause in UPDATE/DELETE.
- 1Start with SELECT * then narrow columns + filters.
- 1Practice the query on sample data, then apply the same pattern to real tables.
- 2Read query output carefully and verify counts when joining/grouping.
- 1Change one clause (WHERE/JOIN/GROUP BY) and predict the row count.
- 2Add a new column to SELECT and rename it with AS.
- 3Write the same query in a slightly different way and compare results.
SQL Default
Learn SQL Default with a small query you can edit and run.
statement;
Edit the SQL below and click Run. The output panel shows a table (for SELECT) or rows affected (for other statements).
SELECT *, then narrow the columns and add filters.| Line | Meaning |
|---|---|
CREATE TABLE demo_users ( | Creates a database object (table/view/index). |
id INTEGER PRIMARY KEY AUTOINCREMENT, | SQL statement line. |
name TEXT NOT NULL, | SQL statement line. |
role TEXT NOT NULL DEFAULT 'user' | SQL statement line. |
); | SQL statement line. |
INSERT INTO demo_users (name) VALUES ('Aarav'); | Inserts new row(s). |
SELECT * FROM demo_users; | Selects columns/expressions. |
- 1Reporting dashboards, analytics, and backend APIs read data with SQL.
- 1Forgetting a WHERE clause in UPDATE/DELETE.
- 1Start with SELECT * then narrow columns + filters.
- 1Practice the query on sample data, then apply the same pattern to real tables.
- 2Read query output carefully and verify counts when joining/grouping.
- 1Change one clause (WHERE/JOIN/GROUP BY) and predict the row count.
- 2Add a new column to SELECT and rename it with AS.
- 3Write the same query in a slightly different way and compare results.
SQL Index
Learn SQL Index with a small query you can edit and run.
statement;
Edit the SQL below and click Run. The output panel shows a table (for SELECT) or rows affected (for other statements).
SELECT *, then narrow the columns and add filters.| Line | Meaning |
|---|---|
CREATE INDEX idx_orders_total ON orders(total_amount); | Creates a database object (table/view/index). |
SELECT name, sql FROM sqlite_master WHERE type = 'index'; | Selects columns/expressions. |
- 1Reporting dashboards, analytics, and backend APIs read data with SQL.
- 1Forgetting a WHERE clause in UPDATE/DELETE.
- 1Start with SELECT * then narrow columns + filters.
- 1Practice the query on sample data, then apply the same pattern to real tables.
- 2Read query output carefully and verify counts when joining/grouping.
- 1Change one clause (WHERE/JOIN/GROUP BY) and predict the row count.
- 2Add a new column to SELECT and rename it with AS.
- 3Write the same query in a slightly different way and compare results.
SQL Auto Increment
Learn SQL Auto Increment with a small query you can edit and run.
statement;
Edit the SQL below and click Run. The output panel shows a table (for SELECT) or rows affected (for other statements).
SELECT *, then narrow the columns and add filters.| Line | Meaning |
|---|---|
CREATE TABLE demo_ai (id INTEGER PRIMARY KEY AUTOINCREMENT, name TEXT); | Creates a database object (table/view/index). |
INSERT INTO demo_ai (name) VALUES ('one'), ('two'); | Inserts new row(s). |
SELECT * FROM demo_ai; | Selects columns/expressions. |
- 1Reporting dashboards, analytics, and backend APIs read data with SQL.
- 1Forgetting a WHERE clause in UPDATE/DELETE.
- 1Start with SELECT * then narrow columns + filters.
- 1Practice the query on sample data, then apply the same pattern to real tables.
- 2Read query output carefully and verify counts when joining/grouping.
- 1Change one clause (WHERE/JOIN/GROUP BY) and predict the row count.
- 2Add a new column to SELECT and rename it with AS.
- 3Write the same query in a slightly different way and compare results.
SQL Dates
Learn SQL Dates with a small query you can edit and run.
statement;
Edit the SQL below and click Run. The output panel shows a table (for SELECT) or rows affected (for other statements).
SELECT *, then narrow the columns and add filters.| Line | Meaning |
|---|---|
SELECT id, created_at | Selects columns/expressions. |
FROM orders | Chooses the source table(s). |
WHERE created_at >= '2026-02-01' | Filters rows before grouping. |
ORDER BY created_at; | Sorts the result set. |
- 1Reporting dashboards, analytics, and backend APIs read data with SQL.
- 1Forgetting a WHERE clause in UPDATE/DELETE.
- 1Start with SELECT * then narrow columns + filters.
- 1Practice the query on sample data, then apply the same pattern to real tables.
- 2Read query output carefully and verify counts when joining/grouping.
- 1Change one clause (WHERE/JOIN/GROUP BY) and predict the row count.
- 2Add a new column to SELECT and rename it with AS.
- 3Write the same query in a slightly different way and compare results.
SQL Views
Learn SQL Views with a small query you can edit and run.
statement;
Edit the SQL below and click Run. The output panel shows a table (for SELECT) or rows affected (for other statements).
SELECT *, then narrow the columns and add filters.| Line | Meaning |
|---|---|
CREATE VIEW v_order_totals AS | Creates a database object (table/view/index). |
SELECT id, total_amount FROM orders; | Selects columns/expressions. |
SELECT * FROM v_order_totals ORDER BY total_amount DESC; | Selects columns/expressions. |
- 1Reporting dashboards, analytics, and backend APIs read data with SQL.
- 1Forgetting a WHERE clause in UPDATE/DELETE.
- 1Start with SELECT * then narrow columns + filters.
- 1Practice the query on sample data, then apply the same pattern to real tables.
- 2Read query output carefully and verify counts when joining/grouping.
- 1Change one clause (WHERE/JOIN/GROUP BY) and predict the row count.
- 2Add a new column to SELECT and rename it with AS.
- 3Write the same query in a slightly different way and compare results.
SQL Injection
Learn SQL Injection with a small query you can edit and run.
statement;
Edit the SQL below and click Run. The output panel shows a table (for SELECT) or rows affected (for other statements).
SELECT *, then narrow the columns and add filters.| Line | Meaning |
|---|---|
SELECT 'Use prepared statements (see notes)' AS info; | Selects columns/expressions. |
- 1Secure logins/search endpoints using parameterized queries.
- 2Prevent SQL injection attacks.
- 1String concatenation with user input.
- 2Logging full SQL with secrets.
- 1Always use prepared statements / parameters in app code.
- 2Validate and limit inputs.
- 1Practice the query on sample data, then apply the same pattern to real tables.
- 2Read query output carefully and verify counts when joining/grouping.
- 1Change one clause (WHERE/JOIN/GROUP BY) and predict the row count.
- 2Add a new column to SELECT and rename it with AS.
- 3Write the same query in a slightly different way and compare results.
SQL Parameters
Learn SQL Parameters with a small query you can edit and run.
statement;
Edit the SQL below and click Run. The output panel shows a table (for SELECT) or rows affected (for other statements).
SELECT *, then narrow the columns and add filters.| Line | Meaning |
|---|---|
SELECT customer_name FROM customers WHERE country = 'India'; | Selects columns/expressions. |
- 1Secure logins/search endpoints using parameterized queries.
- 2Prevent SQL injection attacks.
- 1String concatenation with user input.
- 2Logging full SQL with secrets.
- 1Always use prepared statements / parameters in app code.
- 2Validate and limit inputs.
- 1Practice the query on sample data, then apply the same pattern to real tables.
- 2Read query output carefully and verify counts when joining/grouping.
- 1Change one clause (WHERE/JOIN/GROUP BY) and predict the row count.
- 2Add a new column to SELECT and rename it with AS.
- 3Write the same query in a slightly different way and compare results.
SQL Prepared Statements
Learn SQL Prepared Statements with a small query you can edit and run.
statement;
Edit the SQL below and click Run. The output panel shows a table (for SELECT) or rows affected (for other statements).
SELECT *, then narrow the columns and add filters.| Line | Meaning |
|---|---|
SELECT customer_name FROM customers WHERE country = 'India'; | Selects columns/expressions. |
- 1Secure logins/search endpoints using parameterized queries.
- 2Prevent SQL injection attacks.
- 1String concatenation with user input.
- 2Logging full SQL with secrets.
- 1Always use prepared statements / parameters in app code.
- 2Validate and limit inputs.
- 1Practice the query on sample data, then apply the same pattern to real tables.
- 2Read query output carefully and verify counts when joining/grouping.
- 1Change one clause (WHERE/JOIN/GROUP BY) and predict the row count.
- 2Add a new column to SELECT and rename it with AS.
- 3Write the same query in a slightly different way and compare results.
SQL Hosting
Learn SQL Hosting with a small query you can edit and run.
statement;
Edit the SQL below and click Run. The output panel shows a table (for SELECT) or rows affected (for other statements).
SELECT *, then narrow the columns and add filters.| Line | Meaning |
|---|---|
SELECT 'Read the explanation for this topic.' AS note; | Selects columns/expressions. |
- 1Reporting dashboards, analytics, and backend APIs read data with SQL.
- 1Forgetting a WHERE clause in UPDATE/DELETE.
- 1Start with SELECT * then narrow columns + filters.
- 1Practice the query on sample data, then apply the same pattern to real tables.
- 2Read query output carefully and verify counts when joining/grouping.
- 1Change one clause (WHERE/JOIN/GROUP BY) and predict the row count.
- 2Add a new column to SELECT and rename it with AS.
- 3Write the same query in a slightly different way and compare results.
SQL References
Learn SQL References with a small query you can edit and run.
statement;
Edit the SQL below and click Run. The output panel shows a table (for SELECT) or rows affected (for other statements).
SELECT *, then narrow the columns and add filters.| Line | Meaning |
|---|---|
SELECT customer_name, country FROM customers ORDER BY customer_name LIMIT 5; | Selects columns/expressions. |
- 1Reporting dashboards, analytics, and backend APIs read data with SQL.
- 1Forgetting a WHERE clause in UPDATE/DELETE.
- 1Start with SELECT * then narrow columns + filters.
- 1Practice the query on sample data, then apply the same pattern to real tables.
- 2Read query output carefully and verify counts when joining/grouping.
- 1Change one clause (WHERE/JOIN/GROUP BY) and predict the row count.
- 2Add a new column to SELECT and rename it with AS.
- 3Write the same query in a slightly different way and compare results.
SQL Data Types
Learn SQL Data Types with a small query you can edit and run.
statement;
Edit the SQL below and click Run. The output panel shows a table (for SELECT) or rows affected (for other statements).
SELECT *, then narrow the columns and add filters.| Line | Meaning |
|---|---|
SELECT customer_name, country FROM customers ORDER BY customer_name LIMIT 5; | Selects columns/expressions. |
- 1Reporting dashboards, analytics, and backend APIs read data with SQL.
- 1Forgetting a WHERE clause in UPDATE/DELETE.
- 1Start with SELECT * then narrow columns + filters.
- 1Practice the query on sample data, then apply the same pattern to real tables.
- 2Read query output carefully and verify counts when joining/grouping.
- 1Change one clause (WHERE/JOIN/GROUP BY) and predict the row count.
- 2Add a new column to SELECT and rename it with AS.
- 3Write the same query in a slightly different way and compare results.
SQL Keywords
Learn SQL Keywords with a small query you can edit and run.
statement;
Edit the SQL below and click Run. The output panel shows a table (for SELECT) or rows affected (for other statements).
SELECT *, then narrow the columns and add filters.| Line | Meaning |
|---|---|
SELECT customer_name, country FROM customers ORDER BY customer_name LIMIT 5; | Selects columns/expressions. |
- 1Reporting dashboards, analytics, and backend APIs read data with SQL.
- 1Forgetting a WHERE clause in UPDATE/DELETE.
- 1Start with SELECT * then narrow columns + filters.
- 1Practice the query on sample data, then apply the same pattern to real tables.
- 2Read query output carefully and verify counts when joining/grouping.
- 1Change one clause (WHERE/JOIN/GROUP BY) and predict the row count.
- 2Add a new column to SELECT and rename it with AS.
- 3Write the same query in a slightly different way and compare results.
MySQL Functions
Learn MySQL Functions with a small query you can edit and run.
statement;
Edit the SQL below and click Run. The output panel shows a table (for SELECT) or rows affected (for other statements).
SELECT *, then narrow the columns and add filters.| Line | Meaning |
|---|---|
SELECT customer_name, country FROM customers ORDER BY customer_name LIMIT 5; | Selects columns/expressions. |
- 1Reporting dashboards, analytics, and backend APIs read data with SQL.
- 1Forgetting a WHERE clause in UPDATE/DELETE.
- 1Start with SELECT * then narrow columns + filters.
- 1Practice the query on sample data, then apply the same pattern to real tables.
- 2Read query output carefully and verify counts when joining/grouping.
- 1Change one clause (WHERE/JOIN/GROUP BY) and predict the row count.
- 2Add a new column to SELECT and rename it with AS.
- 3Write the same query in a slightly different way and compare results.
SQL Server Functions
Learn SQL Server Functions with a small query you can edit and run.
statement;
Edit the SQL below and click Run. The output panel shows a table (for SELECT) or rows affected (for other statements).
SELECT *, then narrow the columns and add filters.| Line | Meaning |
|---|---|
SELECT customer_name, country FROM customers ORDER BY customer_name LIMIT 5; | Selects columns/expressions. |
- 1Reporting dashboards, analytics, and backend APIs read data with SQL.
- 1Forgetting a WHERE clause in UPDATE/DELETE.
- 1Start with SELECT * then narrow columns + filters.
- 1Practice the query on sample data, then apply the same pattern to real tables.
- 2Read query output carefully and verify counts when joining/grouping.
- 1Change one clause (WHERE/JOIN/GROUP BY) and predict the row count.
- 2Add a new column to SELECT and rename it with AS.
- 3Write the same query in a slightly different way and compare results.
MS Access Functions
Learn MS Access Functions with a small query you can edit and run.
statement;
Edit the SQL below and click Run. The output panel shows a table (for SELECT) or rows affected (for other statements).
SELECT *, then narrow the columns and add filters.| Line | Meaning |
|---|---|
SELECT customer_name, country FROM customers ORDER BY customer_name LIMIT 5; | Selects columns/expressions. |
- 1Reporting dashboards, analytics, and backend APIs read data with SQL.
- 1Forgetting a WHERE clause in UPDATE/DELETE.
- 1Start with SELECT * then narrow columns + filters.
- 1Practice the query on sample data, then apply the same pattern to real tables.
- 2Read query output carefully and verify counts when joining/grouping.
- 1Change one clause (WHERE/JOIN/GROUP BY) and predict the row count.
- 2Add a new column to SELECT and rename it with AS.
- 3Write the same query in a slightly different way and compare results.
SQL Quick Ref
Learn SQL Quick Ref with a small query you can edit and run.
statement;
Edit the SQL below and click Run. The output panel shows a table (for SELECT) or rows affected (for other statements).
SELECT *, then narrow the columns and add filters.| Line | Meaning |
|---|---|
SELECT customer_name, country FROM customers ORDER BY customer_name LIMIT 5; | Selects columns/expressions. |
- 1Reporting dashboards, analytics, and backend APIs read data with SQL.
- 1Forgetting a WHERE clause in UPDATE/DELETE.
- 1Start with SELECT * then narrow columns + filters.
- 1Practice the query on sample data, then apply the same pattern to real tables.
- 2Read query output carefully and verify counts when joining/grouping.
- 1Change one clause (WHERE/JOIN/GROUP BY) and predict the row count.
- 2Add a new column to SELECT and rename it with AS.
- 3Write the same query in a slightly different way and compare results.