# dbt (Data Build Tool)

> A tool that runs your SQL files. Each one builds a table, in the right order.

**Field:** Data Engineering  
**Category:** Processing  
**Also known as:** dbt, Data Build Tool, dbt Core, dbt Cloud

## Think of it like

It is like a recipe book for your data. Each recipe says what to use, and the book cooks them in the right order.

## Definition

dbt is a tool for writing data transformations as SQL files. Each file is one SELECT that builds a table or view in the warehouse. Files point to each other with ref(), so dbt knows the order to run them in. It also runs tests on the results and writes docs from the code. dbt Core is free and open source; dbt Cloud is the paid service.

## Example

A team keeps 120 SQL models in Git. Each night, dbt builds them in order and runs 300 tests.

## Example code

```console
$ dbt run --select daily_sales
1 of 1 OK created sql table model analytics.daily_sales
```

Build one model. dbt writes the SQL and creates the table in the warehouse.

## Why it matters

It brings code habits to SQL: version control, tests, reviews and docs. That made it the usual tool for the T in ELT.

## Common mistake

Writing table names by hand instead of using ref(). dbt then cannot work out the order.

## Three principles

- **A SELECT per file.** Each one builds a table or view.
- **ref() sets the order.** dbt builds the graph.
- **Tests and docs.** Kept beside the code.

## Related terms

- [dbt Model](https://learn.benibix.com/term/data/dbt-model)
- [Data Transformation](https://learn.benibix.com/term/data/data-transformation)
- [Extract, Load, Transform (ELT)](https://learn.benibix.com/term/data/elt)
- [Data Warehouse](https://learn.benibix.com/term/data/data-warehouse)
- [Git](https://learn.benibix.com/term/development/git)
- [dbt Test](https://learn.benibix.com/term/data/dbt-test)
- [Incremental Model (dbt)](https://learn.benibix.com/term/data/incremental-model)

## Told apart from

- [Airflow vs dbt](https://learn.benibix.com/compare/airflow-vs-dbt): People think dbt and Airflow do the same job. dbt turns raw tables into clean ones with SQL inside the warehouse. Airflow decides when jobs run and in what order. Airflow often starts dbt as one of its tasks. One does the work, and the other keeps the clock.
- [Lakeflow Pipelines vs dbt](https://learn.benibix.com/compare/lakeflow-pipelines-vs-dbt): People think Lakeflow Pipelines is Databricks' own dbt, and it is not quite. Both let you write SQL that says what each table should hold. dbt runs that SQL in batches, in almost any warehouse. Lakeflow Pipelines runs only in Databricks, and it can keep streaming tables fed as new rows arrive. Its rules can drop bad rows on the way in.

---

Source: https://learn.benibix.com/term/data/dbt
Author: Behnia Zarei (a developer in Vienna, Austria, who builds and teaches data, AI and business intelligence at BENIBIX)
Publisher: BENIBIX Learn (https://learn.benibix.com/)
Last updated: 2026-11-19
Licence: CC BY 4.0 (https://creativecommons.org/licenses/by/4.0/). Quote freely with attribution.
