Bird
0
0

What does the {% set %} statement do in dbt?

easy📝 Conceptual Q11 of 15
dbt - Jinja in dbt
What does the {% set %} statement do in dbt?
AIt deletes a table from the database.
BIt runs a SQL query directly.
CIt defines a new model in dbt.
DIt creates a variable to store a value for reuse.
Step-by-Step Solution
Solution:
  1. Step 1: Understand the purpose of {% set %}

    The {% set %} statement in dbt is used to create a variable that holds a value.
  2. Step 2: Identify its use in code reuse

    This variable can then be reused multiple times in your dbt project, making code cleaner and easier to maintain.
  3. Final Answer:

    It creates a variable to store a value for reuse. -> Option D
  4. Quick Check:

    {% set %} creates variables [OK]
Quick Trick: Remember: {% set %} means 'store this value' [OK]
Common Mistakes:
MISTAKES
  • Thinking {% set %} runs SQL directly
  • Confusing it with model creation
  • Assuming it deletes data

Want More Practice?

15+ quiz questions · All difficulty levels · Free

Free Signup - Practice All Questions
More dbt Quizzes