Your question is Top 3 Revenue Bookings. Start with the requirements and the two tables on the right.
Run and submit as often as you like. When you're ready, talk me through your approach or go straight to the code.
Marriott International wants a monthly view of its highest-value bookings across Marriott properties. Write a PostgreSQL query that ranks eligible bookings by revenue within each calendar month.
marriott_bookings to marriott_properties to include the property name.booking_id as a deterministic tie-breaker.| Column | Type | Description |
|---|---|---|
| property_idPK | INTEGER | Unique Marriott property identifier |
| property_name | VARCHAR(120) | Displayed Marriott property name |
| city | VARCHAR(80) | City where the property is located |
| brand | VARCHAR(60) | Marriott brand associated with the property |
| Column | Type | Description |
|---|---|---|
| booking_idPK | INTEGER | Unique booking identifier |
| property_id | INTEGER | Referenced Marriott property identifier |
| check_in_date | DATE | Guest arrival date |
| booking_status | VARCHAR(20) | Current status of the booking |
| total_revenue | NUMERIC(12,2) | Total booking revenue in U.S. dollars |