0
0
dbtdata~10 mins

source() function for raw tables in dbt - Interactive Code Practice

Choose your learning style9 modes available
Practice - 5 Tasks
Answer the questions below
1fill in blank
easy

Complete the code to reference the raw table named 'customers' using the source() function.

dbt
SELECT * FROM [1]('raw', 'customers')
Drag options to blanks, or click blank then click option'
Aselect
Bref
Ctable
Dsource
Attempts:
3 left
💡 Hint
Common Mistakes
Using ref() instead of source() to reference raw tables.
Forgetting to specify the source name as the first argument.
2fill in blank
medium

Complete the code to select the 'id' column from the raw table 'orders' using source().

dbt
SELECT id FROM [1]('raw', 'orders')
Drag options to blanks, or click blank then click option'
Aref
Bsource
Cselect
Dtable
Attempts:
3 left
💡 Hint
Common Mistakes
Using ref() instead of source() for raw tables.
Not specifying the correct source name.
3fill in blank
hard

Fix the error in the code to correctly reference the raw table 'products' using source().

dbt
SELECT * FROM source('raw' [1] 'products')
Drag options to blanks, or click blank then click option'
A,
B.
C;
D:
Attempts:
3 left
💡 Hint
Common Mistakes
Using a dot or colon instead of a comma between arguments.
Missing the comma causing a syntax error.
4fill in blank
hard

Fill both blanks to create a source reference for the raw table 'sales_data' and select the 'amount' column.

dbt
SELECT amount FROM [1]([2], 'sales_data')
Drag options to blanks, or click blank then click option'
A'raw'
Bsource
C'staging'
Dref
Attempts:
3 left
💡 Hint
Common Mistakes
Swapping the function name and source name.
Using ref() instead of source() for raw tables.
5fill in blank
hard

Fill all three blanks to create a source reference for the raw table 'inventory', select the 'product_id' column, and alias it as 'id'.

dbt
SELECT [1] AS [2] FROM [3]('raw', 'inventory')
Drag options to blanks, or click blank then click option'
Aproduct_id
Bid
Csource
Dinventory_id
Attempts:
3 left
💡 Hint
Common Mistakes
Using the wrong alias name.
Using ref() instead of source() for raw tables.
Not aliasing the column properly.