Your question is SQL for User Booking Data. Start with the requirements and the one table 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.
Create a SQL query to extract user booking data for analysis.
Return every booking as one result row, preserving NULL values where the source data has them. Sort the results by user, booking date, and booking ID.
booking_id, user_id, booking_date, destination, booking_status, and total_amountuser_id ascending, booking_date ascending, and booking_id ascending| Column | Type | Description |
|---|---|---|
| booking_idPK | INT | Unique booking identifier |
| user_id | INT | Identifier of the user who made the booking |
| booking_date | DATE | Date when the booking was created |
| destination | VARCHAR(100) | Booking destination |
| booking_status | VARCHAR(30) | Current status of the booking |
| total_amount | DECIMAL(10,2) | Total booking amount |