diff --git a/dbt_project.yml b/dbt_project.yml index 0b61f3f4..7fcb169f 100644 --- a/dbt_project.yml +++ b/dbt_project.yml @@ -7,7 +7,7 @@ version: '1.0.0' config-version: 2 # This setting configures which "profile" dbt uses for this project. -profile: 'default' +profile: 'jaffle_shop' # These configurations specify where dbt should look for different types of files. # The `source-paths` config, for example, states that models in this project can be diff --git a/models/customers.sql b/models/customers.sql index bb0d773c..8e9d8da3 100644 --- a/models/customers.sql +++ b/models/customers.sql @@ -1,9 +1,8 @@ with customers as ( select - id as customer_id, - first_name, - last_name + customer_id as customer_id, + customer_name as customer_name from raw.jaffle_shop.customers @@ -12,10 +11,10 @@ with customers as ( orders as ( select - id as order_id, - user_id as customer_id, + order_id as order_id, + customer_id, order_date, - status + order_cost from raw.jaffle_shop.orders @@ -41,8 +40,7 @@ final as ( select customers.customer_id, - customers.first_name, - customers.last_name, + customers.customer_name, customer_orders.first_order_date, customer_orders.most_recent_order_date, coalesce(customer_orders.number_of_orders, 0) as number_of_orders