Every move a data hero needs.
Every query type a data hero needs - what it is, when to use it, and which villain it defeats.
These are categories by business purpose, not separate SQL languages - one query can easily belong to several at once.
A printable companion to the Handbook, from first SELECT to interview-ready.
The path every data hero climbs, from first query to legend.
SQL foundations
Analytics & BI
Data quality & governance
Data engineering
Advanced
Click a card to expand it.
Query Quest's missions focus on SELECT - reading data without changing it, which is also the safest place to learn. But working data engineers write DDL, DML, and transaction control daily; this section is a quick reference for when you get there.
Defines and changes the shape of the database itself - tables, columns, and constraints - rather than the rows inside them.
CREATE TABLE customers (id SERIAL PRIMARY KEY, name TEXT);
ALTER TABLE customers ADD COLUMN email TEXT;
DROP TABLE old_customers;Adds, changes, or removes the rows inside tables that already exist.
INSERT INTO customers (name) VALUES ('Ava Stone');
UPDATE customers SET email = 'ava@example.com' WHERE id = 1;
DELETE FROM customers WHERE id = 99;Groups a set of changes so they all succeed together or all get undone together - no half-finished updates.
BEGIN;
UPDATE accounts SET balance = balance - 100 WHERE id = 1;
UPDATE accounts SET balance = balance + 100 WHERE id = 2;
COMMIT;Query Quest runs on PostgreSQL. Here's how its SQL compares with the other databases you'll meet at work.
Standard SQL is defined by ISO/IEC 9075. ANSI first standardized it in 1986 (SQL-86) and ISO followed in 1987, which is why people still call it "ANSI SQL". The current edition is SQL:2023. Every major database implements the core of the standard and adds its own extensions on top. None of them implements the full standard - so each one speaks SQL with its own accent.
PostgreSQL is one of the most widely used databases in the world, and it stays close to the standard. JOINs, GROUP BY, CTEs and window functions work almost the same everywhere, so what you learn here transfers to whatever database your job uses.
| Task | PostgreSQL | MySQL | SQL Server | Snowflake | Databricks SQL |
|---|---|---|---|---|---|
| First 10 rows | LIMIT 10 | LIMIT 10 | TOP 10 (or OFFSET/FETCH)1 | LIMIT 10 | LIMIT 10 |
| Join text | || or CONCAT | CONCAT (|| is OR by default)2 | + or CONCAT (|| from 2025)3 | || or CONCAT | || or concat |
| Today's date | CURRENT_DATE | CURRENT_DATE / CURDATE() | CAST(GETDATE() AS date) (CURRENT_DATE from 2025)3 | CURRENT_DATE | current_date() |
| Days between | end - start4 | DATEDIFF(end, start) | DATEDIFF(day, start, end) | DATEDIFF(day, start, end) | DATEDIFF(end, start) |
| 7 / 2 returns | 3 | 3.5000 | 3 | 3.5000005 | 3.5 |
| Case-insensitive match | ILIKE | LIKE (default collation)6 | LIKE (default collation)6 | ILIKE | ILIKE |
| Quote a name with spaces | "Order Date" | `Order Date` | [Order Date] | "Order Date" | `Order Date` |
| Filter on a window result | CTE | CTE | CTE | QUALIFY | QUALIFY |
| Upsert | INSERT … ON CONFLICT (or MERGE, v15+) | INSERT … ON DUPLICATE KEY UPDATE | MERGE | MERGE | MERGE INTO7 |
| Auto-number ID | GENERATED … AS IDENTITY | AUTO_INCREMENT | IDENTITY(1,1) | AUTOINCREMENT / IDENTITY | GENERATED ALWAYS AS IDENTITY7 |
Where you'll meet it: Startups, web backends, and any team that wants a free, standards-friendly database.
Gotcha: Your home base. Watch integer division: 7 / 2 is 3, so CAST one side to numeric.
Where you'll meet it: Web apps and content sites, often behind PHP, WordPress or a classic LAMP stack.
Gotcha: || is OR, not text joining - 'a' || 'b' returns 0. Use CONCAT('a', 'b').
Where you'll meet it: Microsoft and enterprise shops, often next to .NET, Excel and Power BI.
Gotcha: There's no LIMIT. Write SELECT TOP 10 … or ORDER BY … OFFSET 0 ROWS FETCH NEXT 10 ROWS ONLY.
Where you'll meet it: Cloud data warehouses for analytics and BI teams.
Gotcha: Unquoted names are stored in UPPERCASE. Create a column as "OrderDate" in quotes and you must quote it exactly that way every time.
Where you'll meet it: Cloud lakehouses, where data engineering and machine learning share the same tables.
Gotcha: Quote names with backticks, not double quotes - "Order Date" is a string, not a column.
Popularity check (November 2026): DB-Engines' top four are Oracle, MySQL, SQL Server and PostgreSQL, with Snowflake (6th) and Databricks (7th) rising. PostgreSQL is the most used, most admired and most desired database in the 2026 Stack Overflow Developer Survey - the same spots it held in 2025.
DB-Engines Ranking ↗Stack Overflow Developer Survey 2026: Databases ↗Stack Overflow Developer Survey 2025: Technology ↗