subject

When people fly long distances, a direct city-to-city flight is often more expensive than taking two flights with a stop in a hub city. Travelers might save even more money by breaking the trip into three flights with two stops. But for the purposes of this challenge, let's assume that no one is willing to stop three times! You have a table with individual airport-to-airport flights, which contains the following columns.

Id - the unique ID of the flight
Origin - the origin city of the current flight
Destination - the destination city of the current flight
Cost - the cost of the current flight.

The cities are all represented by an abbreviation composed of three uppercase English letters. Your task is to write a select statement that lists all the cheapest possible trips that can be done in two or fewer stops. The outputs should have columns origin, destination, stops (indicating the number of stops in current trips) and total_cost. If two trips cost the same but have a different number of stops, include the one with the fewest stops. Sort the output by origin then by destination.

ansver
Answers: 3

Another question on Computers and Technology

question
Computers and Technology, 21.06.2019 21:00
Which function key is used to enable the spelling & grammar function in a word processing program such as microsoft word?
Answers: 3
question
Computers and Technology, 22.06.2019 01:00
What is added to the < meta > tag to describe the encoding type?
Answers: 2
question
Computers and Technology, 22.06.2019 17:50
Farah works in an office with two other employees. all three share a printer and an internet connection. the utility that makes this possible is defragger quicktime soho winzip
Answers: 1
question
Computers and Technology, 23.06.2019 06:10
The head restraint should be adjusted so that it reaches a.the top of your ears b.the base of your skull c.the top of the head
Answers: 1
You know the right answer?
When people fly long distances, a direct city-to-city flight is often more expensive than taking two...
Questions
question
Mathematics, 23.01.2022 18:20
question
Mathematics, 23.01.2022 18:20
question
Mathematics, 23.01.2022 18:30
question
Computers and Technology, 23.01.2022 18:30
Questions on the website: 13722367