SQLmediumCtes~15m
The Grand Palace Hotel chain wants to identify their most reliable room...
Problem
The Grand Palace Hotel chain wants to identify their most reliable room categories by analyzing booking patterns. For each property, find the top 2 room categories that have the highest ratio of actual stays to reservations (completion rate). A reservation is considered 'completed' if there's a corresponding stay record. Include only room categories that have had at least 3 reservations. If there's a tie in completion rate, prioritize the category with more total reservations.
Examples
Example 1
Example 2
Constraints
- ›Return property_name, room_category, completion_rate, total_reservations
- ›Include only categories with at least 3 reservations
- ›Show top 2 categories per property
- ›Break ties by total reservations (descending)
Reference solution
Reference solution available after you attempt the question.
Ready to solve it?
Start a session on Mockbit #58. Write your SQL, run it against real data, and get graded on correctness, efficiency, query structure, and business understanding.
Related SQL questions
- #46A streaming platform wants to identify content that's experiencing 'viewership...medium
- #55AdMetrics Agency manages digital advertising campaigns across multiple channelsmedium
- #56TelecomCorp wants to analyze call quality degradation patterns across their cell...medium
- #41You're analyzing user engagement for a social media platformeasy
- #42A video streaming platform tracks user viewing sessionshard
← Back homemockbit.io/q/58