⏳ Last days of October! SQLtest.online is free thanks to donations, and we still need to reach this month's goal to keep the site running in November. Every donation counts. Support now →
SQL code copied to buffer
Task 48:

Find the fastest flight

PostgreSQL
Find the fastest flight option between Pulkovo Airport (LED) and Bryansk Airport (BZK) (with one transfer) on the date August 16, 2017. For time calculations, use the fields scheduled_departure and scheduled_arrival
Display a table with fields:
     flight1_no - code for the first flight, 
     departure_airport - departure airport code, 
     connection_airport - transfer airport code,
     flight1_time - first flight duration,
     connection_time - waiting time,
     flight2_no - code for the second flight,
     arrival_airport - airport code,
     flight2_time - second flight duration,
     total_trip_time - total trip time.
Expected result Columns: 9 · Rows: 1
flight1_no departure_airport connection_airport flight1_time connection_time flight2_no arrival_airport flight2_time total_trip_time

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

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