Interview Query

Flight Records

19
Have you seen this question before?

Write a query to create a new table, named flight routes, that displays unique pairs of two locations.

Example:

Note: Duplicate pairs from the flights table, such as Dallas to Seattle and Seattle to Dallas, should have one entry in the flight routes table.

flights table

Column Type
id INTEGER
source_location VARCHAR
destination_location VARCHAR

Output:

Column Type
destination_one VARCHAR
destination_two VARCHAR
Next question: Total Time in Flight
.....
MySQL 8.0.17
Loading editor
Use Shift + Enter to run query