New Year Sale Special Limited Time 65% Discount Offer - Ends in 0d 00h 00m 00s - Coupon code: ac4s65

Examine the code:selectleft(customers.

Examine the code:

select

left(customers.id, 12) as customer_id,

customers.name as customer_name,

case when employees.employee_id is not null then true else false end as is_employee,

event_signups.event_name,

event_signups.event_date,

sum(case when visit_accomodations.type = 'hotel' then 1 end)::boolean as booked_hotel,

sum(case when visit_accomodations.type = 'car' then 1 end)::boolean as booked_ride

from customers

-- one customer can sign up for many events

left join event_signups

on left(customers.id, 12) = event_signups.customer_id

-- an event signup for a single customer can have many types of accommodations booked

left join visit_accomodations

on event_signups.signup_id = visit_accomodations.signup_id

and left(customers.id, 12) = visit_accomodations.customer_id

-- an employee can be a customer

left join employees

on left(customers.id, 12) = employees.customer_id

group by 1, 2

dbt-Analytics-Engineering PDF/Engine
  • Printable Format
  • Value of Money
  • 100% Pass Assurance
  • Verified Answers
  • Researched by Industry Experts
  • Based on Real Exams Scenarios
  • 100% Real Questions
buy now dbt-Analytics-Engineering pdf
Get 65% Discount on All Products, Use Coupon: "ac4s65"