Bird
0
0

Which of the following is the correct syntax to specify a column type in a model contract in schema.yml?

easy📝 Syntax Q3 of 15
dbt - Governance and Collaboration
Which of the following is the correct syntax to specify a column type in a model contract in schema.yml?
A- column: customer_id\n datatype: int
B- name: customer_id\n type: integer
C- field: customer_id\n type: string
D- name: customer_id\n datatype: varchar
Step-by-Step Solution
Solution:
  1. Step 1: Recall correct syntax for column definitions

    In schema.yml, columns are defined with name and type keys.
  2. Step 2: Match options to syntax

    - name: customer_id\n type: integer uses name and type correctly. Others use incorrect keys like column, datatype, or field.
  3. Final Answer:

    - name: customer_id\n type: integer -> Option B
  4. Quick Check:

    Column type syntax uses name and type = B [OK]
Quick Trick: Use 'name' and 'type' keys for columns in schema.yml [OK]
Common Mistakes:
MISTAKES
  • Using 'datatype' instead of 'type'
  • Using 'column' or 'field' instead of 'name'
  • Mixing SQL types with dbt contract types

Want More Practice?

15+ quiz questions · All difficulty levels · Free

Free Signup - Practice All Questions
More dbt Quizzes