TASK #229 · Easy · AmadeusBusiest Routes
Your brief
The flights table stores flights within Spain with the departure airport
origin and the arrival airport destination (IATA codes). A route
is an (origin, destination) pair with direction: MAD → BCN and
BCN → MAD are different routes.
Write a query that returns the routes with 3 or more flights in the table, cancelled ones included: origin, destination and the number of flights flights_count. Sort by flights_count in descending order and, on ties, by origin and then by destination alphabetically.
Write a query that returns the routes with 3 or more flights in the table, cancelled ones included: origin, destination and the number of flights flights_count. Sort by flights_count in descending order and, on ties, by origin and then by destination alphabetically.
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