Write a query to find the top three most-searched destinations for each user segment on Expedia Group over the last thirty days.
Use user_segments to identify each user's segment and destination_searches to count destination searches. Include only searches in the rolling 30-day period and exclude searches that cannot be assigned to a segment or destination.
segment, destination, and search_count.segment, descending search_count, and ascending destination to break ties.| Column | Type | Description |
|---|---|---|
| user_idPK | INT | Unique Expedia Group user identifier |
| segment | VARCHAR(50) | User segment used for reporting |
| Column | Type | Description |
|---|---|---|
| search_idPK | INT | Unique destination search event identifier |
| user_id | INT | User who performed the search |
| destination | VARCHAR(100) | Destination searched by the user |
| searched_at | DATE | Calendar date of the search |