Write a SQL query using window functions to find the top three most-booked hotel destinations for each customer segment over the last quarter at Expedia Group.
For this exercise, treat the last quarter as April 1, 2025 through June 30, 2025. Include only confirmed bookings, count bookings by destination within each segment, and return exactly three destinations per segment when available.
Output
- One row per customer segment and destination, with
segment_name, destination_name, booking_count, and destination_rank.
- Include only the top three destinations for each segment. Break equal booking counts alphabetically by destination name.
- Order by
segment_name, then destination_rank.