SQL
Master the language of data — the relational model, SELECT and filtering, aggregation, every join, subqueries, CTEs and window functions, schema design, indexes, transactions and query optimization.
Your progress
0 / 27 chapters
0%
01
Foundations
The relational model, SELECT, WHERE filtering, and sorting/limiting.
- 8mWhat is SQLThe language of relational databases, and why it is everywhere.
- 9mThe Relational ModelTables, rows, columns, keys — how relational data is organised.
- 8mSELECT BasicsRetrieve columns from a table — the most-used SQL statement.
- 9mFiltering with WHEREReturn only the rows that match a condition.
- 7mSorting & LimitingOrder results and return just the top rows.
02
Core Queries
DISTINCT, aliases, aggregate functions, GROUP BY, HAVING and built-in functions.
- 7mDISTINCT & AliasesRemove duplicates and rename columns and tables.
- 8mAggregate FunctionsSummarise many rows into one value — COUNT, SUM, AVG, MIN, MAX.
- 9mGROUP BYAggregate per category — the analytical workhorse.
- 7mHAVINGFilter groups after aggregation — the WHERE for groups.
- 8mBuilt-in FunctionsTransform text, numbers and dates in your queries.
03
Joins & Combining
INNER, LEFT/RIGHT, FULL/CROSS and self joins, plus UNION set operations.
- 10mINNER JOINCombine rows from two tables where they match on a key.
- 9mLEFT & RIGHT JOINKeep unmatched rows from one side, filling gaps with NULL.
- 7mFULL & CROSS JOINKeep everything, or combine every pair of rows.
- 7mSelf JoinsJoin a table to itself to model hierarchies and pairs.
- 7mUNION & Set OperationsStack query results vertically with UNION, INTERSECT, EXCEPT.
04
Advanced Queries
Subqueries, CTEs, window functions and CASE expressions.
- 9mSubqueriesA query inside a query — compare against computed values.
- 9mCommon Table ExpressionsName a query with WITH to make complex logic readable.
- 10mWindow FunctionsRank, run totals, and compare to neighbours — without collapsing rows.
- 7mCASE ExpressionsConditional logic inside a query — if/else for SQL.
05
Data & Schema
Modifying data, defining tables and types, constraints, indexes and transactions.
- 9mINSERT, UPDATE, DELETEAdd, change and remove rows — safely.
- 9mCREATE TABLE & Data TypesDefine tables and choose the right column types.
- 9mConstraintsRules the database enforces to keep data valid.
- 9mIndexesSpeed up queries by letting the database jump to matching rows.
- 8mTransactionsGroup statements so they all succeed or all fail.
06
Applied SQL
Views and stored routines, query optimization, and professional best practices.
