Data Engineering · Intermediate

SQL, Data Modeling and Data Warehousing

Write advanced analytical SQL, design dimensional models, and build tested warehouse transformations with dbt on modern cloud and open-source warehouses.
LevelIntermediateDuration14 hoursFormatLive online cohortSchedule7 live online sessions x 2 hours, including guided hands-on lab time in every session

Course overview

What you'll learn

SQL, Data Modeling and Data Warehousing moves you from writing queries to designing the structures those queries run on. You learn advanced SQL patterns, read query plans, model data into facts and dimensions, and compare how Postgres, Snowflake, BigQuery, and Redshift store and scan data. Every session pairs a focused explanation with a lab you build and run yourself.

Who it's for

Data Analysts, Analytics Engineers, Aspiring Data Engineers, Backend Developers

By the end you will be able to

  • Write multi-step analytical queries using CTEs, joins, and window functions such as ranking, running totals, and lag and lead
  • Read an execution plan and apply indexing, partitioning, and rewrite techniques to improve a slow query
  • Design a star schema with fact and dimension tables and choose an appropriate grain
  • Implement slowly changing dimensions and explain the trade-offs between the common types
  • Compare Postgres, Snowflake, BigQuery, and Redshift in terms of storage, compute, and cost models
  • Build dbt models with tests for uniqueness, null values, relationships, and accepted values

Industry use cases

Examples from the work you do

Retail

Model orders, products, and stores into a star schema so merchandising teams can compare sales across any time period and category.

Fintech

Build a transaction fact table with slowly changing customer dimensions to support point-in-time reporting and reconciliation.

SaaS

Use window functions and CTEs to compute retention, rolling usage, and cohort metrics from raw event tables.

Healthcare IT

Structure de-identified encounter data into dimensional marts with data quality tests that catch broken keys before reports refresh.

Logistics

Model shipments and delivery events as an accumulating snapshot fact to measure stage-by-stage lead times.

Telecom

Partition and cluster large usage tables, then verify with query plans that common reports scan far less data.

Syllabus

7 modules, 14 hours.

Every module ends with a hands-on lab you can apply to your own work.

01Advanced SQL: CTEs, Joins and Set Logic2 hours

Structure complex queries so they stay readable, correct, and easy to debug.

  • Common table expressions and when to chain them
  • Join types, join fan-out, and duplicate row pitfalls
  • Semi-joins and anti-joins with EXISTS and NOT EXISTS
  • Set operations: UNION, INTERSECT, and EXCEPT
  • Conditional aggregation with CASE and FILTER
  • Handling NULLs correctly in comparisons and aggregates

Hands-on lab: Rewrite a nested, hard-to-read reporting query as a chain of CTEs, then find and fix a join that silently doubles revenue.

02Window Functions for Analytics2 hours

Use window functions to answer ranking, trend, and sessionization questions without self-joins.

  • PARTITION BY, ORDER BY, and frame clauses (ROWS versus RANGE)
  • ROW_NUMBER, RANK, and DENSE_RANK for top-N and deduplication
  • LAG and LEAD for period-over-period change
  • Running totals and moving averages
  • NTILE and percentile calculations
  • Gaps-and-islands patterns for streaks and sessions

Hands-on lab: From a raw events table, compute daily active users, a 7-day moving average, and each user's first and most recent action using window functions.

03Query Performance and Execution Plans2 hours

Diagnose why a query is slow and apply the right fix for the engine you are on.

  • Reading EXPLAIN and EXPLAIN ANALYZE output
  • B-tree indexes, composite indexes, and covering indexes
  • Sargable predicates and avoiding functions on indexed columns
  • Join algorithms: nested loop, hash, and merge
  • Table statistics and why stale statistics mislead the planner
  • Partitioning and pruning basics

Hands-on lab: Take a slow query on a multi-million-row Postgres table, capture its plan, apply an index and a rewrite, and compare plans and timings before and after.

04Dimensional Modeling and Star Schema2 hours

Turn business processes into fact and dimension tables that are simple to query and hard to misuse.

  • Business process, grain, dimensions, and facts: the four design steps
  • Transaction, periodic snapshot, and accumulating snapshot fact tables
  • Surrogate keys versus natural keys
  • Conformed dimensions and the bus matrix
  • Slowly changing dimensions: Type 1, Type 2, and Type 3
  • Star versus snowflake schema and when normalizing dimensions helps

Hands-on lab: Design a star schema for an order-to-delivery process on paper, then create the tables in Postgres and load a Type 2 customer dimension from sample change data.

05Warehouse Architectures: Snowflake, BigQuery, Redshift and Postgres2 hours

Understand how columnar, distributed warehouses differ from row-store databases, and how that changes design and cost.

  • Row stores versus columnar storage and compression
  • Separation of storage and compute in Snowflake and BigQuery
  • Redshift distribution styles and sort keys
  • Partitioning and clustering in BigQuery and Snowflake
  • Cost models: per-query scan, warehouse time, and provisioned nodes
  • When Postgres is enough and when to move to a dedicated warehouse

Hands-on lab: Load the same dataset into Postgres and a cloud warehouse trial or free tier, run an identical query on both, and write a short comparison of plans, scanned bytes, and likely cost drivers.

06Transformations with dbt2 hours

Manage warehouse transformations as versioned, modular, documented code.

  • dbt project structure: sources, staging, intermediate, and mart layers
  • Models, ref(), and the dependency graph
  • Materializations: view, table, and incremental
  • Jinja basics and reusable macros
  • Seeds and snapshots for reference data and history
  • Generating documentation and lineage graphs

Hands-on lab: Build a dbt project that stages raw tables, produces a fact table and two dimensions, and renders the generated documentation site.

07Data Quality Testing and Delivery2 hours

Catch bad data before stakeholders do, and ship models with a repeatable workflow.

  • Generic dbt tests: unique, not_null, accepted_values, and relationships
  • Singular tests for custom business rules
  • Source freshness checks
  • Severity levels and deciding what should fail a run
  • Using the dbt-utils and dbt-expectations packages
  • Running dbt in CI with Git pull requests

Hands-on lab: Add a full test suite to your dbt project, introduce bad rows into the source data on purpose, and confirm each failure is caught with a clear message.

Capstone project

Build something you'll use

Design and build a small analytics warehouse for a business scenario of your choice: a dimensional model with at least one fact and three dimensions, dbt transformations with tests and documentation, and three analytical queries using window functions, each with a short note on its execution plan. You present the model and trade-off decisions to the cohort for feedback.

Tools and requirements

What you'll work with

PostgreSQLSnowflakeGoogle BigQueryAmazon Redshiftdbt CoreDBeaverDockerGit

Prerequisites

  • Working knowledge of basic SQL: SELECT, WHERE, GROUP BY, and simple joins
  • Comfort with the command line and installing software locally
  • A laptop able to run Docker (setup guidance provided before the first session)

Frequently asked questions

Before you book.

How do I book this course?

Select "Book a seat" and complete the short form. We email you the next cohort dates, timings and fees, and your seat is secured when you confirm. Requesting a seat is free.

How is the course delivered?

Live and online. The 14 hours run as 7 live online sessions x 2 hours, including guided hands-on lab time in every session, led by an instructor, with hands-on labs in every session.

What do I need to join?

Working knowledge of basic SQL: SELECT, WHERE, GROUP BY, and simple joins Comfort with the command line and installing software locally A laptop able to run Docker (setup guidance provided before the first session)

Can my team take this course together?

Yes. We can run this course for a team with examples from your own roles and tools. Send a team request through the contact page.

Continue exploring

Related courses.

Live online

Data Engineering

Data Pipelines and Orchestration

Build reliable batch ETL and ELT pipelines with Python, Airflow, and dbt, using incremental loads, idempotent design, testing, lineage, and lakehouse storage formats.

Intermediate16 hours

Ready to start?

Join the next SQL, Data Modeling and Data Warehousing cohort.

Book a seat
Book your seat