Courses / Course 04

dbt in Practice

The tool most data teams use to turn SQL into a tested, documented project.

  • IntermediateLevel
  • about 1.5 hoursTo complete
  • 5 lessonsWith checked exercises
  • FreeNo account needed

What you will learn

  • Structure a project into sources, staging and marts
  • Write built-in and custom tests
  • Reuse logic with macros
  • Build incremental models that handle late data

Syllabus

  1. 1
    Sources, staging and marts

    How a dbt project is organised, and why every model has one job.

    14 min
  2. 2
    Tests that catch real problems

    A dbt test is a query that returns the bad rows. Zero rows means the test passes.

    14 min
  3. 3
    Macros and documentation

    Write a rule once and reuse it everywhere, then explain your models so others can use them.

    12 min
  4. 4
    Incremental models

    Process only the new data each run, without missing rows that arrive late.

    14 min
  5. 5
    Mini project: five seasons of city bikes

    Build a tested mart that compares every bike season from 2021 to 2025.

    18 min

The data you will use

Helsinki City Bikes

Real open data from the city bike system in Helsinki and Espoo. Bikes are available from April to October each year, so there is no data for the winter months.

Tables: stations, daily_trips

Nordic Shop

A small online shop based in Finland that sells electronics, home goods, sports gear, books and outdoor clothing. Customers sign up, place orders on the website or in the app, and each order contains one or more products.

Tables: customers, products, orders, order_items

The lesson Sources, staging and marts walks you through every table and column. Under every code box you can also open a list of the tables and what each column means.

Learn in public on GitHub

Do the exercises in the browser, or in the public course repo so your work shows on your GitHub profile.

  1. Fork the course repo

    One click on GitHub gives you your own copy with every exercise and dataset.

  2. Solve and open a pull request

    Put your answers in your own folder and open a pull request. A bot checks them and comments with ✅ or ❌.

  3. Join the graduates

    Finished a course? Add your name to GRADUATES.md. Your work stays on your GitHub profile for recruiters to see.

Open this course on GitHub →

What you will build

Turn five seasons of Helsinki city bike trips into a tested season mart.

Based on a real project: Helsinki City Bikes