Most Recent Booking per Cabin
Captains want a quick summary of each cabin's most recent guest in case follow-up is needed. For every cabin booked at least once, output the cabin id, the latest passenger's name, and the end_date of that booking.
Expected output sample
This is what a correct answer looks like — its row count is its own, it doesn't have to match the schema tables.
| name | cabin_id | end_date |
|---|---|---|
| Mia | 1 | 2024-05-03 |
| Noah | 2 | 2024-01-20 |
| Eliza | 3 | 2024-02-03 |
Sign in to see submission history
Sign inSign in to use AI Mentor
Sign in