🚀 November has started! SQLtest.online stays free thanks to donations from people like you. Help us reach this month's goal early so the site keeps running without interruptions. Support now →
SQL code copied to buffer
Task 238:

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