Skip to content
Intermediate · Self-paced2026 Edition

SQL Intermediate — Analytical Patterns

Bridge from query-writing to analysis. Window functions in depth, CTE pipelines, and the four shapes that cover most working-analyst output: reporting, cohort, funnel, time-series.

8

Modules

~6h 50m

Reading time

Intermediate

Level

Self-paced

Format

§

Syllabus

  1. 01

    Reporting vs analysis — the four shapes

    Recognise which of the four query shapes a question wants before you write the SELECT.

    ~40 minModule 01
  2. 02

    Window functions in depth

    ROW_NUMBER vs RANK vs DENSE_RANK, LAG/LEAD, FIRST_VALUE, frame specifications.

    ~55 minModule 02
  3. 03

    CTEs and query composition

    Multi-CTE pipelines, materialisation behaviour, the dbt-style readability pattern.

    ~45 minModule 03
  4. 04

    Cohort analysis and retention curves

    Build cohort tables, compute retention, recognise when cohort isn't the right unit.

    ~60 minModule 04
  5. 05

    Funnels and conversion

    Multi-step funnel queries, step-over-step drop-off, the 'within N days' constraint.

    ~55 minModule 05
  6. 06

    Time-series — moving averages, PoP, gaps

    Rolling aggregates, period-over-period change, date spines, gap-and-island problems.

    ~60 minModule 06
  7. 07

    Cleaning and reshaping

    Pivot/unpivot, deduplication with ROW_NUMBER, slowly-changing dimensions (SCD2).

    ~50 minModule 07
  8. 08

    Trusting queries — sanity checks and NULL traps

    Pre-share checklist, the three NULL traps that cause silent wrong answers, UNION/JOIN/EXISTS by intent.

    ~45 minModule 08

How to use this course

Start with module 01 if the material is new; skip ahead if you have prior exposure. Each module is self-contained but the arc is sequential — the projects in the final module assume the toolkit from modules 1-11. Every module ends with key takeaways and a curated further-reading list with primary sources.