dbt is a tool for transforming data that already sits in your warehouse. Each model is a SELECT statement saved as a SQL file, and dbt builds those models into tables or views in dependency order, worked out from the ref() function you use to point one model at another. On top of that it adds data tests, documentation, Jinja templating and macros, so analytics code gets the habits of software engineering: version control, code review and repeatable builds. Learnr builds a dbt course around your SQL level and warehouse, with short lessons that follow how a real project grows.
How to learn dbt, step by step
- Get solid at SQL first. dbt does not replace SQL, it organizes it. Make sure you are comfortable with joins, CTEs, GROUP BY, CASE expressions and window functions, because every model you write is a SELECT statement built from those pieces.
- Set up a project on a sample dataset. Connect dbt to a warehouse or a local database such as DuckDB, load a few CSV files as seeds and run dbt build. Watching tables appear and reading the compiled SQL shows how the tool works under the hood.
- Declare sources and build staging models. Define raw tables in a sources YAML file, then create one staging model per source table that renames columns, casts types and does light cleaning. Every later model should read from staging through ref(), never from raw tables.
- Add tests and documentation early. Put unique and not_null tests on primary keys, relationships tests on foreign keys and accepted_values on status columns. Add descriptions in YAML, run dbt docs generate and explore the lineage graph it produces.
- Learn incremental models carefully. Switch a large model to incremental, use is_incremental() to filter new rows and set a unique_key for updates. Test a full refresh against an incremental run, since subtle bugs here create silently wrong data.
- Write macros and review concepts daily. Move repeated SQL into Jinja macros and try a community package such as dbt_utils. Ten minutes of Learnr practice a day helps materializations, ref and source, and test types become second nature.
What you'll learn
- Write dbt models and connect them with ref() and source()
- Choose between view, table, incremental and ephemeral materializations
- Add tests such as unique, not_null, accepted_values and relationships
- Organize a project into staging, intermediate and mart layers
- Reuse logic with Jinja and macros and generate project documentation
How long does it take to learn dbt?
If your SQL is already solid, you can build a small dbt project with tests in 1 to 2 weeks at 5 hours a week. Getting comfortable with incremental models, macros, project structure and deployment usually takes 1 to 3 months of work on a real dataset.
What you need before you start
Confident SQL, including joins, CTEs and aggregations. Basic Git and command-line skills help a lot, and an understanding of data warehousing ideas like fact and dimension tables makes project structure easier.
Common mistakes to avoid
- Hardcoding table names instead of using ref() and source(), which breaks the dependency graph and makes dbt build models in the wrong order.
- Putting all logic into one giant model. Smaller staging, intermediate and mart models are easier to test, reuse and debug.
- Skipping tests on primary keys, so duplicate rows from a bad join flow into every downstream report unnoticed.
How Learnr builds your course
Type your topic
Tell Learnr you want to learn dbt, or get as specific as you like.
Get a personalized course
Learnr instantly builds a full dbt course tailored to your goal and skill level.
Learn and level up
Move through bite-sized lessons and interactive practice, earning XP and keeping your streak.
dbt questions, answered
Is dbt an ETL tool?
dbt handles the transform step only. It assumes data has already been loaded into your warehouse by another tool, which is why it is usually described as the T in an ELT workflow.
Is dbt free?
dbt Core is open source and free to run from the command line. dbt Labs also sells a hosted product with a browser IDE, scheduling and other features, so check their site for current plans.
Do I need Python to use dbt?
Mostly no. Models are written in SQL with Jinja templating, and configuration lives in YAML files. Some warehouses support Python models in dbt, but they are optional and far less common than SQL ones.
Explore more courses
More data and ai courses
- Learn Apache Airflow
- Learn ETL
- Learn SPSS
- Learn Stata
- Learn SAS
- Learn Jupyter Notebooks
- Learn Kaggle
- Learn Feature Engineering
Ready to learn dbt?
Start your free, personalized dbt course in seconds. It will be typed in and ready when you get there.
Start learning dbtFree to start. No credit card.