# dbt Model

> One SQL file in dbt. It builds one table or view.

**Field:** Data Engineering  
**Category:** Processing  
**Also known as:** Model (dbt), dbt SQL Model

## Think of it like

It is like one card in a recipe box. It makes one dish, and it can use dishes made by other cards.

## Definition

A dbt model is one SQL file that holds one SELECT statement. When dbt runs, it wraps the SELECT. It builds a table or a view with the file's name. A model reads other models with ref() and raw tables with source(). A setting says how it is built: as a table, a view, or by adding new rows.

## Example

One model file adds up orders by day. dbt turns it into a table in the warehouse with the same name.

## Example code

```sql
-- models/daily_sales.sql
SELECT order_date, SUM(total) AS sales
FROM {{ ref('stg_orders') }}
GROUP BY order_date
```

This model builds the sales table for each day. It reads from a second model.

## Why it matters

Models are the building blocks of a dbt project. Small models are easy to test and reuse.

## Common mistake

Making every model a table. Light steps can be views, which cost no storage and are always fresh.

## Three principles

- **One file, one table.** The name is the file name.
- **Only a SELECT.** dbt writes the rest.
- **ref() and source().** How models find their inputs.

## Related terms

- [dbt (Data Build Tool)](https://learn.benibix.com/term/data/dbt)
- [Data Transformation](https://learn.benibix.com/term/data/data-transformation)
- [Database View](https://learn.benibix.com/term/development/database-view)
- [Extract, Load, Transform (ELT)](https://learn.benibix.com/term/data/elt)
- [dbt Test](https://learn.benibix.com/term/data/dbt-test)
- [dbt Source](https://learn.benibix.com/term/data/dbt-source)

---

Source: https://learn.benibix.com/term/data/dbt-model
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.
