Stage 2 of 8 · 9 lessons · ~5 weeks
Analytical SQL and data modelling
Write the analytical SQL pipelines depend on, then design warehouse tables that answer business questions: facts, dimensions, grain, history and layers.
Start: Analytical SQL: CTEs and aggregationLessons· one lesson for each topic, in this order
- 1Analytical SQL: CTEs and aggregationLesson
- 2Window functionsLesson
- 3SQL performance at scaleLesson
- 4OLTP and OLAPLesson
- 5Facts, dimensions and grainLesson
- 6Star and snowflake schemasLesson
- 7Slowly changing dimensionsLesson
- 8Kimball, data vault and one big tableLesson
- 9Medallion and layered architectureLesson
Do this
- Solve 20 analytical SQL problems, including at least 8 with window functions.
- Write a deduplication query that keeps the latest row per key with a deterministic tie-breaker.
- Write the grain of your main fact table in one sentence.
- Draw a star schema for your dataset with a date dimension and at least two others.
- Implement one Type 2 dimension with valid_from, valid_to and a current flag.
- Organise your tables into bronze, silver and gold schemas.
Start with
- CourseFreeSQL Tutorial for Data Analysis (formerly Mode)
ThoughtSpot · Beginner
Its advanced section covers window functions, performance tuning and pivoting on realistic data
Practise
Keep handy
Also worth your time
Star and snowflake schemas, facts and dimensions, and the steps of a warehouse design in one read
Before moving on: A star schema design for your dataset: a written grain statement, a diagram of one fact table and at least three dimensions (one of them Type 2), and SQL that builds them in DuckDB or PostgreSQL with a deduplicated silver layer.

Modelling is the skill that separates a data engineer from someone who moves files around. Always write the grain in one sentence before you create a fact table. If the SQL and databases roadmap is new to you, do its querying and joins stages first; this stage builds on them rather than repeating them.