Recall & Review
beginner
What is the purpose of the
source() function in dbt?The
source() function in dbt is used to reference raw tables or external data sources in your project. It helps you track and document where your data comes from.Click to reveal answer
beginner
How do you use the
source() function in a dbt model?You use
source('source_name', 'table_name') inside your SQL to refer to a raw table defined in your sources.yml file. This makes your code clear and maintainable.Click to reveal answer
beginner
What file do you configure to define sources for the
source() function?You define sources in a
sources.yml file inside your dbt project. This file lists the source names and their raw tables with metadata.Click to reveal answer
intermediate
Why is using
source() better than hardcoding raw table names?Using
source() helps track data lineage, improves documentation, and makes your project easier to update if raw table names or locations change.Click to reveal answer
intermediate
Can
source() be used to reference tables outside your dbt project?Yes,
source() can reference external raw tables as long as they are defined in your sources.yml file and accessible by your data warehouse.Click to reveal answer
What does
source('raw', 'customers') do in dbt?✗ Incorrect
The source() function references an existing raw table defined in sources.yml. It does not create, delete, or transform tables.
Where do you define the sources used by the
source() function?✗ Incorrect
Sources are defined in sources.yml files to list raw tables and their metadata.
Why should you use
source() instead of hardcoding table names?✗ Incorrect
Using source() helps track where data comes from and documents your sources clearly.
Can
source() reference tables outside your dbt project?✗ Incorrect
source() can reference any table accessible by your warehouse if defined properly.
What is the correct syntax to reference a source table named 'orders' in source 'raw_data'?
✗ Incorrect
The syntax is source('source_name', 'table_name'), so source('raw_data', 'orders') is correct.
Explain how the
source() function helps manage raw tables in dbt projects.Think about how you keep track of where your data comes from.
You got /4 concepts.
Describe the steps to set up and use the
source() function for a new raw table.Start from configuration, then usage, then benefits.
You got /4 concepts.