Interview Query

Flight Records

Start Timer

0:00:00

Upvote
44
Downvote
Save question
Mark as completed
View comments (66)
Next question

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
.
.
.
.
.


Comments

Loading comments.