A dbt model is just a SELECT saved as a file:
SQL
-- models/daily_revenue.sql
SELECT
order_date,
SUM(amount) AS revenue
FROM {{ ref('stg_orders') }}
GROUP BY order_date
Run it and dbt materializes the result as a table or view:
Shell
dbt run --select daily_revenue
ref() is the point: it wires models into a dependency graph, so
dbt always builds upstream models first — your pipeline is the SQL
plus its order, nothing more.