TASK #236 · Hard · eDreams ODIGEORepeat Customers
Your brief
A repeat eDreams ODIGEO customer is one with at least two confirmed bookings
(status = 'confirmed') in bookings. Cancelled bookings do not count.
Write a query that for each repeat customer returns full_name, the date of the first confirmed booking first_booking, the date of the second one second_booking, and the number of days between them days_between. Sort the result by days_between ascending and, in case of a tie, by full_name.
Write a query that for each repeat customer returns full_name, the date of the first confirmed booking first_booking, the date of the second one second_booking, and the number of days between them days_between. Sort the result by days_between ascending and, in case of a tie, by full_name.
Ctrl / ⌘ + ↵
Result
Write a query and run it to see the results.
Schema
customerscustomer_id, full_name, country, signup_datesessionssession_id, customer_id, market, ab_variant, device, session_datefunnel_eventsevent_id, session_id, step, event_timebookingsbooking_id, session_id, customer_id, market, booking_date, origin, destination, total_amount, status