TASK #232 · Hard · AmadeusHighest Average Booking Price per Month
Your brief
The bookings table stores ticket bookings: flight flight_id, date
booking_date, price price and status status. The airline of
a flight is in flights.airline_code.
Write a query that, using confirmed bookings (status = 'Confirmed'), finds for every month of booking_date the airline with the highest average booking price. Return the month mth in the 'YYYY-MM' format, airline_name and avg_price rounded to two decimals. If several airlines share the highest average, return all of them. Sort by mth and then by airline_name.
Write a query that, using confirmed bookings (status = 'Confirmed'), finds for every month of booking_date the airline with the highest average booking price. Return the month mth in the 'YYYY-MM' format, airline_name and avg_price rounded to two decimals. If several airlines share the highest average, return all of them. Sort by mth and then by airline_name.
Ctrl / ⌘ + ↵
Result
Write a query and run it to see the results.
Schema
airlinesairline_code, airline_name, countryflightsflight_id, flight_number, airline_code, origin, destination, scheduled_departure, actual_departure, statusbookingsbooking_id, flight_id, booking_date, price, status