Complete the code to define a staging model that selects all columns from the raw source table.
select * from [1]
The staging layer reads directly from the raw source tables, so the correct source is raw.customers.
Complete the code to create an intermediate model that joins staging customers with staging orders.
select c.customer_id, c.name, o.order_id, o.order_date from [1] c join [2] o on c.customer_id = o.customer_id
BLANK_1 is staging.customers (C) and BLANK_2 is staging.orders (B). Intermediate models join staging tables.
Fix the error in the intermediate model code by choosing the correct table for orders.
select c.customer_id, c.name, o.order_id, o.order_date from staging.customers c join [1] o on c.customer_id = o.customer_id
The intermediate model should join staging orders, so staging.orders is the correct choice.
Fill both blanks to create a mart model that aggregates total sales per customer from the intermediate orders table.
select customer_id, sum([1]) as total_sales from [2] group by customer_id
The mart model sums order_amount from the intermediate.orders table.
Fill all three blanks to create a mart model that calculates average order value per customer using intermediate data.
select [1], avg([2]) as avg_order_value from [3] group by [1]
The mart model groups by customer_id, averages order_amount, and reads from intermediate.orders.