Mockbit/#58
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
← Back homemockbit.io/q/58
PrivacyTerms© 2026 Mockbit