Bird
0
0

Which of the following is the correct syntax to reference a model named sales_summary in dbt?

easy📝 Syntax Q12 of 15
dbt - Governance and Collaboration
Which of the following is the correct syntax to reference a model named sales_summary in dbt?
Aselect * from ref('sales_summary')
Bselect * from {{ ref('sales_summary') }}
Cselect * from sales_summary
Dselect * from {{ sales_summary }}
Step-by-Step Solution
Solution:
  1. Step 1: Recall dbt syntax for referencing models

    dbt uses Jinja templating with double curly braces and ref() to reference models.
  2. Step 2: Identify correct syntax

    The correct syntax is select * from {{ ref('model_name') }} to properly resolve the model.
  3. Final Answer:

    select * from {{ ref('sales_summary') }} -> Option B
  4. Quick Check:

    Use {{ ref('model') }} for model references [OK]
Quick Trick: Use double curly braces with ref() for model references [OK]
Common Mistakes:
MISTAKES
  • Omitting curly braces around ref()
  • Using ref() without quotes
  • Trying to reference model without ref()

Want More Practice?

15+ quiz questions · All difficulty levels · Free

Free Signup - Practice All Questions
More dbt Quizzes