dbt manages dependencies through sources and refs.
Sources: External tables loaded by other tools.
SELECT * FROM {{ source('stripe', 'payments') }}
Refs: References to other dbt models.
SELECT * FROM {{ ref('stg_payments') }}
Why this matters:
- dbt builds dependency graph automatically
- Runs models in correct order
- Enables lineage documentation
- Allows impact analysis
Never hardcode table names. Always use source() or ref().