Skip to content

dbt (data build tool) is a tool for transforming data that has already been loaded into a data warehouse. You write each transformation as a SQL SELECT statement saved in a file, and dbt turns that statement into a table or view, runs the files in dependency order, and checks the results with tests you define. It does not extract data from source systems or load it into the warehouse; other tools do that first.

The letters are short for "data build tool", the phrase dbt Labs used in the package description of early releases; its current documentation writes only "dbt". For a step-by-step build, follow the dbt tutorial for beginners; the dbt hub lists the rest of this site's dbt material.

What dbt is and what it is not

dbt connects to your data warehouse (the analytic database your company queries, such as Snowflake, BigQuery, Databricks, or Redshift) and sends it SQL. You supply select statements, and dbt supplies the statements around them that create and replace tables and views. Your data is not processed outside the warehouse. dbt Labs' FAQ is direct about the limit: dbt is a transformation tool, is not designed to extract or load data, and is not supported for that use.

AreaWhat dbt doesWhat dbt does not do
Moving dataLoads small CSV files kept in the project (seeds)Extract data from source systems or load raw data
TransformingWraps each select in a create view as or create table as statement and runs itProcess or store data itself; the SQL runs in your warehouse
Run orderWorks out which model depends on which and runs them in orderSchedule itself when self-hosted: cron, Airflow, or another scheduler calls it. The hosted dbt platform has a scheduler
Data qualityRuns the tests you define and reports pass or failCheck rows before they are written; a data test runs on a model that is already built
CleanupReplaces a model's table or view on rebuildDrop the table or view when you delete the model
ReportingGenerates documentation and records dashboards as exposuresDraw charts; visualization tools read the tables dbt builds

Where dbt sits in ELT

ELT stands for extract, load, transform: copy raw data out of source systems, load it into the warehouse unchanged, then transform it there with SQL. dbt is the T. An ingestion tool or script lands the raw tables, dbt builds cleaned, joined, and aggregated tables from them, and dashboards and notebooks query what dbt built. ETL vs. ELT explained simply covers why the order of the letters matters.

A model is a SELECT statement that dbt materializes

The unit of work in dbt is the model. A SQL model is one select statement in one .sql file, and the file name becomes the name of the table or view. You do not write create table or insert. When you run dbt run, dbt wraps the statement in the right create statement for your database and executes it. To materialize a model is to create it as an object in the database. Models can also be written in Python on some platforms, but most are SQL.

One model and the SQL dbt ran for it

This example was run for this article with dbt Core 1.12.7 (the v1 engine, explained below) and the dbt-postgres 1.11.0 adapter on PostgreSQL 16. The project has two models: stg_orders, a view of the completed orders in a raw table, and customer_orders, which summarizes that view. This is models/customer_orders.sql as written:

{{ config(materialized='table') }}

select
    customer_id,
    count(*) as order_count,
    sum(amount) as total_amount,
    min(order_date) as first_order_date
from {{ ref('stg_orders') }}
group by customer_id

The config block tells dbt to build a table and not the default view, and ref('stg_orders') stands in for the other model's name. After dbt run, the file target/run/shop/models/customer_orders.sql held the statement dbt had sent to Postgres (the spacing is dbt's own):

  create  table "ae_scratch_whatisdbt"."analytics"."customer_orders__dbt_tmp"


    as

  (


select
    customer_id,
    count(*) as order_count,
    sum(amount) as total_amount,
    min(order_date) as first_order_date
from "ae_scratch_whatisdbt"."analytics"."stg_orders"
group by customer_id
  );

The config line is gone, because it was an instruction to dbt and not SQL. ref('stg_orders') became a full database, schema, and object name: ae_scratch_whatisdbt was the scratch database and analytics the schema in the connection settings. The log shows dbt created stg_orders first, built this table under a temporary name, then renamed it to customer_orders. Querying it returned:

 customer_id | order_count | total_amount | first_order_date
-------------+-------------+--------------+------------------
         101 |           3 |       125.50 | 2026-10-01
         102 |           1 |        80.00 | 2026-10-03
         103 |           1 |        12.25 | 2026-10-20
(3 rows)

ref() and the dependency graph

ref() is the function you write in place of a table name when one model selects from another. The documentation calls it the most important function in dbt and gives it two jobs. First, it fills in the schema for the environment you are running in, so one file reads from your development schema while you work and from production in a scheduled run. Second, it records that this model depends on the other one.

From those records dbt builds a dependency graph, usually called the DAG (directed acyclic graph): a map of which models feed which, with no loops. dbt run uses it to build models in the right order, and by default skips the models downstream of one that fails.

Materializations

A materialization is the strategy dbt uses to persist a model in the warehouse. Five are built in, and the default is a view. You set one with materialized in the model's config block, in a properties file, or for a whole folder in dbt_project.yml.

MaterializationWhat dbt createsWhen the documentation suggests it
viewA view, recreated on each runThe starting point; light work such as renaming or recasting columns
tableA table, rebuilt in full on each runModels that dashboards query, and slow transformations that many models read
incrementalA table that dbt inserts into or updates with the records since the last runEvent-style data, once full rebuilds are too slow
ephemeralNothing in the database; the SQL is inlined into the models that reference it as a common table expression (a named subquery)Light logic used by one or two downstream models
materialized_viewA materialized view that the database maintainsWhere incremental would do but you want the platform to manage the refresh; not on every platform

The other parts of a dbt project

A project is a folder with a dbt_project.yml configuration file and a directory for each kind of resource (how to structure a dbt project covers the layout). Besides models, the main resources are:

  • Tests. A data test is a query that returns the rows that break a rule, and it passes when it returns none. Four ship with dbt: unique, not_null, accepted_values, and relationships. Unit tests check a model's logic against fixed inputs before the model is built. See the complete guide to tests in dbt.
  • Documentation. You describe models and columns in YAML files next to the code, and dbt generates a documentation site that also shows the model code, the DAG, and column types read from the warehouse.
  • Sources. A source names a raw table that your extract and load tool put in the warehouse. Models select from it with source(), which adds it to the graph, and you can test it and check its freshness. ref() vs. source() compares the two functions.
  • Seeds. Seeds are CSV files in the project that dbt seed loads as tables. They suit small, static lookups such as country codes, not raw data. See the guide to seeds.
  • Snapshots. A snapshot records how rows in a table that gets overwritten change over time, keeping each past version of a row with dbt_valid_from and dbt_valid_to columns. The documentation calls this a type 2 slowly changing dimension. See snapshots explained.

Model files can also contain Jinja, a templating language; the double braces in the example are Jinja. It adds if statements, for loops, and macros (reusable snippets of SQL), which dbt renders to plain SQL before anything runs. Because a project is a folder of text files, it is kept in Git and changed through pull requests.

dbt v1, dbt v2, and the dbt platform

Older articles split dbt into dbt Core, the free command-line tool, and dbt Cloud, the hosted service. As of November 2026 the documentation names four things instead:

Name in the documentationWhat it isLicense and costOlder name
dbt v2 (package dbt)The current engine, written in Rust; the default when you install dbtFree to install and run; proprietary licensedbt Fusion engine
dbt OSS (package dbt-oss)The open-source distribution of the same Rust engine, without dbt Labs' proprietary additionsFree; Apache 2.0None
dbt v1 (package dbt-core)The original engine, written in Python and still maintainedFree; Apache 2.0dbt Core
dbt platformThe hosted service: a browser-based editor, job scheduling, continuous integration, hosted documentation, monitoring, and alerting. It runs v1 or v2Plans from Developer (free) to Enterprise+dbt Cloud

The language is the same in all four: the model files, ref(), YAML, and tests described here. dbt Labs says a v1 project's language carries over to v2, though v2 validates more strictly and removes deprecated features. The engines differ in which databases they reach: v2 ships with its adapters built in, while v1 uses separately installed adapter plugins, which is how the Postgres example ran (Postgres is not on the v2 list). The licensing FAQ says dbt Core 1.13 will be the last minor release of v1. For running dbt yourself versus paying for the hosted service, see the dbt Cloud vs. dbt Core feature comparison, which uses the older names.

Who uses dbt

The project's README says dbt is for data analysts and engineers who want to transform data with the practices software engineers use to build applications. The documentation sets the bar at anyone on a data team who knows SQL. The dbt Viewpoint, the project's founding statement, traces dbt to a team at RJMetrics in 2015 and 2016 who wanted version control, testing, and documentation for analytic code.

If you already write SQL for reports, the new parts are ref(), the project layout, tests, and Git, not the SQL. On this site that combination is taught as the work of an analytics engineer.

Frequently Asked Questions

Is dbt an ETL tool?

No. dbt covers the transform step only, and only for data that is already in the warehouse. dbt Labs' documentation says it is not designed to extract or load data. A separate ingestion tool extracts and loads the raw data first.

What is the difference between dbt Core and dbt Cloud?

dbt Core was the free, open-source command-line tool that you run yourself, and dbt Cloud was the hosted service around it, with a browser editor and a job scheduler. The documentation now calls the hosted service the dbt platform and the original Python engine dbt v1. A newer Rust engine, dbt v2, is installed by default.

Is dbt free?

The software is. dbt Labs' licensing page says dbt v2 and dbt OSS are free to install and run and that dbt v1 remains available under the Apache 2.0 license. The hosted dbt platform has a free Developer plan with paid plans above it. Because dbt runs its SQL in your warehouse, the warehouse still bills you for those queries.

Which databases does dbt work with?

For dbt v2, the documentation lists Snowflake, BigQuery, Databricks, and Redshift as generally available, DuckDB for command-line use, and Apache Spark and ClickHouse in beta. dbt v1 connects through adapter plugins maintained by dbt Labs, partners, and community members, including one for Postgres. Either way, you write models in the SQL dialect of your own database.

Primary sources and further reading

All of these were published by dbt Labs and read in November 2026. Names, adapter status, and plans will change.