Course page
Log in

You are watching a free preview. Enroll to open all 26 lessons, track progress and ask the course tutor.

Enroll for $54.99

Section 1: How dbt thinks

What dbt is and where it sits

Video 9 min Lesson 1 of 26 Sample clip Preview

dbt is the T in ELT. Data has already been extracted and loaded into your warehouse by some other tool. dbt takes over from there: it compiles SQL select statements into tables and views, in the right order, and runs tests on the results.

That is the whole job. dbt does not move data between systems, does not schedule itself and does not store data. It talks to your warehouse through an adapter (dbt-snowflake, dbt-bigquery, dbt-postgres, dbt-duckdb and many others) and lets the warehouse do the computing.

What you get in exchange

  • Models are just SELECTs. You write the query; dbt wraps it in the right create table or create view statement for your warehouse.
  • Dependencies are explicit. When one model refers to another with ref(), dbt knows the order and can draw the lineage graph.
  • Tests live next to the code. Uniqueness, not null, accepted values and relationships are declared in YAML and run with one command.
  • Documentation is generated. Descriptions you write in YAML become a browsable site with lineage.

dbt Core and the dbt platform

dbt Core is the open source command line tool, installed with pip. The commercial dbt platform adds a hosted IDE, scheduling and other team features. dbt Labs has also been building a newer engine called Fusion. Everything in this course uses dbt Core and plain SQL, so the skills apply wherever you run it.

The commands you will use most

dbt debug        # check the connection
dbt run          # build models
dbt test         # run tests
dbt build        # run, test, snapshot and seed in dependency order
dbt docs generate

By the end of this section you will have a working project on DuckDB and your first three models.

← → switch lessons