Practice - 5 Tasks
Answer the questions below
1fill in blank
easyComplete the code to define a source name in YAML.
dbt
sources:
- name: [1] Drag options to blanks, or click blank then click option'
Attempts:
3 left
💡 Hint
Common Mistakes
Using spaces in the source name
Omitting the source name
Using invalid characters in the name
✗ Incorrect
The name field defines the source name. Here, my_source is a valid source name.
2fill in blank
mediumComplete the code to specify the database for the source.
dbt
sources:
- name: my_source
[1]: analytics_db Drag options to blanks, or click blank then click option'
Attempts:
3 left
💡 Hint
Common Mistakes
Confusing
schema with databaseOmitting the database key
Using an incorrect key name
✗ Incorrect
The database key specifies the database where the source tables reside.
3fill in blank
hardFix the error in the source table definition by completing the missing key.
dbt
sources:
- name: my_source
database: analytics_db
tables:
- [1]: users Drag options to blanks, or click blank then click option'
Attempts:
3 left
💡 Hint
Common Mistakes
Using
table_name instead of nameUsing
table as the keyOmitting the table name key
✗ Incorrect
The correct key to define a table inside tables is name.
4fill in blank
hardFill both blanks to define a source with a schema and a table name.
dbt
sources:
- name: my_source
database: analytics_db
[1]: public
tables:
- name: [2] Drag options to blanks, or click blank then click option'
Attempts:
3 left
💡 Hint
Common Mistakes
Mixing up
database and schemaUsing
table instead of name for the tableOmitting the schema key
✗ Incorrect
The schema key defines the schema name, and users is the table name.
5fill in blank
hardFill all three blanks to define a source with database, schema, and a table with an alias.
dbt
sources:
- name: my_source
[1]: analytics_db
[2]: sales
tables:
- name: orders
[3]: sales_orders Drag options to blanks, or click blank then click option'
Attempts:
3 left
💡 Hint
Common Mistakes
Using
table instead of alias for renamingMixing up schema and database keys
Omitting the alias key when renaming
✗ Incorrect
The database and schema keys specify where the source lives. The alias key gives the table a different name in dbt.