SQL Intermediate Recap — JOIN, Subqueries, and Window Functions at a Glance

A single-page recap of all 14 intermediate SQL articles — aggregate functions and GROUP BY, INNER/OUTER JOIN, subqueries and EXISTS, set operators, CTEs, window functions, and transactions — tied together with diagrams and a classification table.

Big picture of what you learned in SQL Intermediate

This page consolidates the syntax covered in the SQL Intermediate series along four axes: aggregating multiple rows into one, joining multiple tables with JOIN and subqueries, computing across rows with window functions, and committing changes together with transactions.

Use the links to jump back to any article for review.

Big picture of what SQL Intermediate covers
roll upaggregate / GROUP BYtabledata in multiple tablescombineJOIN / subqueryset opsUNION / EXISTS / CTEcompute acrosswindow functionscommit togethertransactionaggregatejoinsetacrossupdate
Roll rows up with aggregates, combine multiple tables with JOIN and subqueries, compute across rows with window functions, and commit your changes together with transactions.

Aggregate rows and join multiple tables

Aggregate functions and GROUP BY collapse multiple rows into one value, while JOIN connects multiple tables through a shared column.

The diagram below maps out the 2 aggregate articles and the 3 join articles.

5 articles on aggregation and joining
aggregateroll rows upaggregate fnsCOUNT / SUM / etc.GROUP BYand HAVINGjoinconnect tablesINNER JOINand aliases
Aggregate functions roll rows up, and GROUP BY aggregates per group. JOIN spans 3 articles — INNER, OUTER, and practical usage — covering how to connect tables.
CategoryArticleWhat you'll learn
AggregateAggregate FunctionsWhole-table aggregation with COUNT / SUM / AVG / MIN / MAX
AggregateGROUP BY and HAVINGGroup aggregation, HAVING, and the difference vs. WHERE
JoinINNER JOIN and aliasesAliases, INNER JOIN, ON / USING
JoinOUTER / CROSS / self joinLEFT / RIGHT / FULL, CROSS, self joins
JoinJOIN in practiceCombining JOIN with WHERE / ORDER BY / CASE

Compose with subqueries, set operators, and window functions

Subqueries and EXISTS let you embed one query inside another, set operators and CTEs glue result sets together and keep things readable, and window functions compute rank and running totals across rows.

The diagrams below map subqueries / EXISTS / set operators / CTE, and the 3 window function articles.

5 articles on subqueries, set operators, and CTEs
subquerya query inside a querySubquery ①IN / WHERESubquery ②FROM / SELECTEXISTScorrelated subqueryset operatorsUNION familyCTE / WITHrecursive CTE
Subqueries and EXISTS embed one query inside another; set operators and CTEs glue result sets together to keep complex SQL readable.
4 articles on window functions and transactions
window functionscompute across rowsOVERPARTITION BYORDER BYand framesranking / analyticexecution ordertransactioncommit together
Window functions span 3 articles — OVER / PARTITION, ORDER BY and frames, and ranking / analytic functions. Transactions group changes so you can commit or undo them as one.
CategoryArticleWhat you'll learn
SubquerySubquery ① IN / WHEREScalar, IN, aggregation in WHERE, intro to correlated subqueries
SubquerySubquery ② FROM / SELECTDerived tables, SELECT-clause subqueries, CREATE / INSERT SELECT
EXISTSEXISTS and correlated subqueriesEXISTS / NOT EXISTS and how NULL interacts with EXISTS
Set opsUNION / INTERSECT / EXCEPTUnion, intersection, difference, and UNION ALL
CTEWITH (CTE) and recursive CTEsReadability gains and hierarchy traversal with recursive CTEs
Window ①OVER / PARTITION BYAggregate windows and PARTITION BY
Window ②ORDER BY and framesRunning totals and frame specs (ROWS / RANGE)
Window ③Ranking / analytic functions and execution orderROW_NUMBER / RANK / LAG / LEAD / NTILE and SQL execution order
TransactionTransactions and locksBEGIN / COMMIT / ROLLBACK, SAVEPOINT, AUTOCOMMIT

Nice work!

You've now tied together aggregation and GROUP BY, joining multiple tables with JOIN, subqueries and EXISTS, set operators and CTEs, window functions, and transactions in one sweep.

Combine these pieces and you can write the vast majority of the analysis, aggregation, and reporting queries you'll bump into in real work.

Jump back to any article that caught your eye and try the patterns on your own data.