🙏 We need your help! SQLtest.online has no ads and lives only on donations. Even a small amount helps. Donate now →
SQL code copied to buffer
Task 50:

Itinerary of a Booking

PostgreSQL
A family calls the airline about booking 070133. Build its itinerary: one row per passenger and flight.
Output the columns passenger_name, flight_no, departure_city, arrival_city, scheduled_departure, fare_conditions and seat_no (the seat from the boarding pass, NULL if the passenger hasn't checked in yet), sorted by passenger_name, then by scheduled_departure.
Expected result Columns: 7 · Rows: 10
passenger_name flight_no departure_city arrival_city scheduled_departure fare_conditions seat_no

Sample rows open after wrong checks: 0 of 2

Write your query below and click "Check it!". Tables are described in the right pane.

Tutorial

By checking a query, you agree that it is stored without your account details and may be included in anonymized datasets, including for AI training. Learn more

The query result will appear here. Ctrl+Enter - Run query