Stage 5 track
Track A: Data Analyst & Analytics Engineer
Goal: Turn the SQL you now own into the modern analytics stack — dimensional models, dbt, BI tools, warehouse dialects — and ship a dashboard-backed warehouse as your capstone. Time: 4–6 weeks alongside the capstone · Builds on: everything, but especially Stages 2 and 4
Who this track is for
You liked Part 8 best. Cohorts, funnels, growth tables felt like your questions, and you want the job where answering them is the work: analyst, analytics engineer, BI developer. SQL stays your primary language; this track adds the modelling discipline and the toolchain around it.
The path
1. Dimensional modeling. The reporting counterpart to Part 9: organise data as fact tables (measurable events at a declared grain — one row per order line) surrounded by dimension tables (the who/what/when that describe them). Star schemas trade Part 9's update-safety for read-simplicity — legitimate, because warehouses are rebuilt, not updated in place. Practise by re-drawing shopdb as a star: fact_order_items with keys into dim_customer, dim_product, dim_date. Say the grain out loud before every table; grain mistakes are the fan-out bug (Part 5) at warehouse scale.
2. Slowly changing dimensions. Customers move cities; last quarter's report must not retroactively move with them. Type 1 overwrites (no history); Type 2 closes the old row and inserts a new one with validity dates and an is_current flag — you already wrote this pattern's DML in Part 11, and the Part 8 window functions read it back. Build dim_customer as Type 2 and prove a mid-year move leaves January's revenue in the old city.
3. dbt fundamentals. dbt turns your CTE pipelines into versioned, tested, documented models — each model a SELECT, materialised as views or tables, dependencies inferred, dbt test asserting uniqueness and referential integrity (Part 10's constraints, re-expressed for a warehouse that lacks them). Incremental models re-process only new rows. Everything you wrote in the Stage 2 project becomes a dbt project almost line for line.
4. Connecting BI tools. Metabase (open source, 10-minute start) or any BI tool speaks to Postgres directly. The division of labour that keeps dashboards fast and honest: modelled tables (dbt) answer questions; the BI layer visualises them — it should never hold business logic the warehouse doesn't.
5. Warehouse dialects. BigQuery and Snowflake are column-store warehouses: your SQL carries over nearly intact (window functions, CTEs, QUALIFY as a bonus), while the cost model flips — they bill by data scanned, so SELECT * becomes a money bug, partitioning/clustering replace Part 17's indexes, and Part 18's sargability instinct becomes a budgeting skill.
6. DuckDB for local analysis. DuckDB is the analyst's pocket knife: an in-process engine (SQLite's shape, analytics' speed) that queries CSV and Parquet files directly — SELECT ... FROM 'sales.parquet'. Your Postgres SQL mostly just runs. Use it for the "I have a 2 GB CSV and a question" days.
Capstone: the e-commerce analytics warehouse
Build, from shopdb (scale it with Tune It's generator if you like):
- A star schema —
fact_order_items,dim_customer(Type 2),dim_product,dim_date— as a dbt project. - dbt tests: uniqueness on every dimension key, not-null on every fact foreign key, an accepted-values test on status.
- The Stage 2 analytics pack (RFM, cohorts, rankings, trend) rebuilt as dbt models on the star.
- A Metabase dashboard on top: revenue trend, category ranking, cohort table.
- One documented SCD proof: move a customer's city, rebuild, show history preserved.
Done when: dbt build runs green end to end, every model documented, and the dashboard answers the four pack questions without a single hand-written join in the BI layer.