dbt Fundamentals
Back to dbt Foundations: What and Why

The dbt Project Structure — A Tour

Walking through dbt_project.yml, models/, tests/, macros/, seeds/, snapshots/. Where everything lives and why. FIND_VIDEO: search 'dbt project structure folders' — recommended channel: dbt Labs. Aim for 10 min or under.

20 minutesVideo LessonPDF notes
🎯 Free Guest Mode: You are learning for free. Sign in to save your completion progress and quiz answers.
Loading progress...

Key moments

  1. Analysis Directory — Covers running administrative and ad-hoc SQL scripts that compile without generating warehouse relations.
  2. Project Configuration File — Explains how dbt_project.yaml defines project settings, links database profiles, and sets default materializations.
  3. Macros and Jinja Logic — Demonstrates writing reusable Jinja functions to eliminate duplicated transformation code across models.
  4. Project README — Outlines standard documentation practices for onboarding contributors and detailing project context.
  5. Static Seed Data — Details uploading version-controlled CSV lookup tables to the warehouse using the dbt seed command.
  6. Snapshots for SCD2 — Describes preserving historical records of mutating source tables using automated snapshot configurations.
  7. Singular Tests — Reviews custom SQL assertions where any returned rows indicate a test failure.
  8. Models Directory — Introduces the primary directory where SQL and Python transformation models reside.
PDF notes

Frequently asked questions

Why does dbt compile analysis SQL files without building tables or views?

Analyses are designed for ad-hoc queries, administrative tasks, and auditing. Compiling them interpolates Jinja references without cluttering your database schema.

What makes singular tests in the tests/ directory different from generic tests?

Singular tests are standalone .sql files containing bespoke queries that fail on any returned rows, whereas generic tests are reusable parameter-driven YAML definitions.

Why are seeds considered an anti-pattern when overused?

Seeds are committed to git repositories, making them inefficient for fast-changing, high-volume data that should instead enter via production ingestion pipelines.

How was this lesson?

Your feedback helps us refine explanations and catch bugs.