Write a SQL query using a JOIN and an aggregate function to calculate the average onboard spend per guest, grouped by cruise itinerary at Carnival Cruise Line.
Use the provided itinerary and guest spending data. Include only guests with a recorded onboard spend.
itinerary_name and average_onboard_spend.| Column | Type | Description |
|---|---|---|
| itinerary_idPK | INT | Unique identifier for the cruise itinerary |
| itinerary_name | VARCHAR(100) | Carnival cruise itinerary name |
| Column | Type | Description |
|---|---|---|
| spend_idPK | INT | Unique identifier for the guest spending record |
| guest_id | INT | Identifier for the guest |
| itinerary_id | INT | Itinerary associated with the guest spending record |
| onboard_spend | DECIMAL(10,2) | Recorded onboard spend for the guest |