SQL Tutorial
A complete walk-through of SQL โ 4 tiers, 12 chapters. Each chapter builds on the last and uses the same sample schema (users, orders, products, order_items). Start at Chapter 01 or jump to what you need.
Spreadsheets vs databases, tables/rows/columns, your first SELECT, NULL, and SQL dialects.
Comparison operators, AND/OR/NOT, LIKE, BETWEEN, IN, and IS NULL.
ORDER BY, multi-column sort, NULL ordering, LIMIT/OFFSET, aliases, and DISTINCT.
COUNT/SUM/AVG, GROUP BY, HAVING vs WHERE, and a window-function preview.
Foreign keys, INNER/LEFT/RIGHT/FULL joins, self joins, and CROSS JOIN.
INSERT, UPDATE, DELETE, TRUNCATE, transactions, and ACID.
CREATE TABLE, data types, constraints, foreign keys, and normalisation (1NFโ3NF).
B-trees, composite/partial indexes, EXPLAIN, and common slow-query patterns.
Scalar/correlated subqueries, WITH clauses, and recursive CTEs for hierarchies.
PARTITION BY, frame clauses, ranking functions, and LAG/LEAD.
Upsert/MERGE, JSONB, pivot/unpivot, and LATERAL joins.
Zero-downtime migrations, SQL injection, roles & RLS, style conventions, and a capstone.
Interview-critical chapters (if short on time): 02 (WHERE), 04 (Aggregation), 05 (Joins), 09 (CTEs), 10 (Window Functions).