mediumAirAsia · joinsPro
Revenue per route
AirAsia wants total fare revenue for each route it flies.
Join routes to bookings and return each route's origin, destination, and total fare as total_revenue, for routes with at least one booking.
Schema
▸routes
| id | INT |
| origin | TEXT |
| destination | TEXT |
▸bookings
| id | INT |
| route_id | INT |
| fare | NUMERIC(8,2) |
Pro
The example input, expected output, and walkthrough for this question unlock with a Pro plan.
Pro
This is a Pro question
Premium practice questions unlock with a Pro plan. The full solution, expected output, and grading are available to Pro members.