Notice: This page requires JavaScript to function properly.
Please enable JavaScript in your browser settings or update your browser.
Extended Flight Join Challenge | Joining Tables
Intermediate SQL

Extended Flight Join ChallengeExtended Flight Join Challenge

Task

You need to join the three tables: passenger, departure and flights:

  1. Select name_passenger and surname_passenger from the passenger table;
  2. Select travel_time from the flights table;
  3. Join the departure table and passenger table by the number_of_departure column. Join the departure table and flights table by flight_number column;
  4. Make filtering: flight time (travel_time column) must be more than 10 hours.

Here's a short example of the departure table:

number_of_departureflight_numberdeparture_datedeparture_time
132022-07-1608:00:00
212022-07-1813:15:00
............
632022-07-1608:00:00

Here's a short example of the passenger table:

idnumber_of_departurename_passengersurname_passenger
15LiamSmith
25OliviaJohnson
............
185OliviaJohnson

Here's a short example of the flights table:

flight_numberstart_point_flightend_point_flighttravel_time
1ParisNew York8
2ChicagoNew Delhi15
3New YorkDubai12
4Los AngelesHonolulu5

Everything was clear?

Section 3. Chapter 7
toggle bottom row
course content

Course Content

Intermediate SQL

Extended Flight Join ChallengeExtended Flight Join Challenge

Task

You need to join the three tables: passenger, departure and flights:

  1. Select name_passenger and surname_passenger from the passenger table;
  2. Select travel_time from the flights table;
  3. Join the departure table and passenger table by the number_of_departure column. Join the departure table and flights table by flight_number column;
  4. Make filtering: flight time (travel_time column) must be more than 10 hours.

Here's a short example of the departure table:

number_of_departureflight_numberdeparture_datedeparture_time
132022-07-1608:00:00
212022-07-1813:15:00
............
632022-07-1608:00:00

Here's a short example of the passenger table:

idnumber_of_departurename_passengersurname_passenger
15LiamSmith
25OliviaJohnson
............
185OliviaJohnson

Here's a short example of the flights table:

flight_numberstart_point_flightend_point_flighttravel_time
1ParisNew York8
2ChicagoNew Delhi15
3New YorkDubai12
4Los AngelesHonolulu5

Everything was clear?

Section 3. Chapter 7
toggle bottom row
some-alt