Complete the code to reference the raw table named 'customers' using the source() function.
SELECT * FROM [1]('raw', 'customers')
The source() function is used to reference raw tables in dbt. Here, source('raw', 'customers') points to the 'customers' table in the 'raw' source.
Complete the code to select the 'id' column from the raw table 'orders' using source().
SELECT id FROM [1]('raw', 'orders')
Use source('raw', 'orders') to reference the raw 'orders' table. Then select the 'id' column.
Fix the error in the code to correctly reference the raw table 'products' using source().
SELECT * FROM source('raw' [1] 'products')
Arguments in the source() function must be separated by a comma. So use source('raw', 'products').
Fill both blanks to create a source reference for the raw table 'sales_data' and select the 'amount' column.
SELECT amount FROM [1]([2], 'sales_data')
The correct syntax is source('raw', 'sales_data'). Here, source is the function and 'raw' is the source name.
Fill all three blanks to create a source reference for the raw table 'inventory', select the 'product_id' column, and alias it as 'id'.
SELECT [1] AS [2] FROM [3]('raw', 'inventory')
The code selects the 'product_id' column, aliases it as 'id', and references the raw 'inventory' table using source('raw', 'inventory').