AlgoMaster Logo
All categories

SQL Animations

Joins, window functions, and how queries actually execute.

01

Query Execution

How the database parses, plans and runs a query, and the order its clauses run in.

  1. 01Query Execution Order
  2. 02Query Lifecycle
02

Joins

Inner, outer, cross and self joins, row by row, as matches are found.

  1. 01Inner Join
  2. 02Left Join
  3. 03Right Join
  4. 04Full Outer Join
  5. 05Cross Join
  6. 06Self Join
03

Aggregation & Grouping

GROUP BY, HAVING, ROLLUP and CUBE turning many rows into a few.

  1. 01Group By
  2. 02Aggregate Functions
  3. 03Having Vs Where
  4. 04Grouping Sets
  5. 05CUBE vs ROLLUP
  6. 06Window Vs Group By
04

Functions & Expressions

DISTINCT, CASE, COALESCE and NULLIF reshaping values in place.

  1. 01DISTINCT
  2. 02CASE Expression
  3. 03COALESCE / NULLIF
05

Subqueries & CTEs

Inner queries, correlated lookups and recursive CTEs feeding the outer query.

  1. 01Subquery
  2. 02Correlated Subquery
  3. 03IN vs EXISTS
  4. 04Cte
  5. 05Recursive Cte
06

Set Operations

UNION, INTERSECT and EXCEPT combining the rows of two queries.

  1. 01Union Vs Union All
  2. 02Intersect Except
07

Window Functions

Ranks, running totals and LAG/LEAD computed over a sliding frame of rows.

  1. 01Row Number Rank
  2. 02Lag Lead
  3. 03Ntile
  4. 04Partition By
  5. 05Frame Clause
  6. 06Running Total
  7. 07FIRST_VALUE / LAST_VALUE
  8. 08PERCENT_RANK / CUME_DIST