The goal in this scenario is:
Select only models, tests, and snapshots that were modified in development, using:state:modified
Use already-built production objects whenever possible, so development does not need to rebuild everything. This is done with:--defer
Compare development code against production artifacts, which requires:--state
Run everything (models + tests + snapshots) in a single command. This is exactly what dbt build does.
Putting it all together, the correct command is:
dbt build --select state:modified --defer --state
This single command satisfies all requirements:
It runs only modified resources.
It uses the production state artifacts for comparison.
It defers to production-built models where possible.
It runs all resource types automatically.
Why the other options are incorrect:
A → Missing --state, so state:modified cannot function.
B → Splits run + test separately; question asks which single command you will invoke.
D → Missing --defer, which defeats the purpose of using production objects.
E → Also missing --defer.
Thus, Option C is the only correct answer.