Given a bookings table and a listings attribute table (e.g. country), write SQL to compute how many listings were booked for the first time ever on each day.
Asked in the technical phone screen stage. The table setup is visible in the post, and the first booked per day metric was confirmed by the OP in a reply.
booking_date, first_time_booked_listingsbooking_date ascending| Column | Type | Description |
|---|---|---|
| booking_idPK | BIGINT | Unique booking record identifier |
| listing_id | BIGINT | Identifier of the listing that was booked |
| booking_date | DATE | Date when the booking was created |
| guest_id | BIGINT | Identifier of the guest who made the booking |
| Column | Type | Description |
|---|---|---|
| listing_idPK | BIGINT | Unique listing identifier |
| country | VARCHAR(64) | Listing country |
| city | VARCHAR(128) | Listing city |