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, 24.06.2019 00:10
Read each statement below. if the statement describes a peer-to-peer network, put a p next to it. if the statement describes a server-based network, put an s next to it. p - peer-to-peer s - server-based
Answers: 1
question
Computers and Technology, 24.06.2019 07:20
Ingrid started speaking about her slide presentation. when she clicked to th"third slide, which had just a picture of an elephant, she forgot what she wassupposed to talk about. what could ingrid do to avoid this situation in thefuture? oa. print handouts for her audience.ob. add presenter's notes to each slide.oc. add a video to each slide.od. save her slide presentation to a flash drive
Answers: 2
question
Computers and Technology, 24.06.2019 08:00
Java the manager of a football stadium wants you to write a program that calculates the total ticket sales after each game
Answers: 1
question
Computers and Technology, 24.06.2019 22:00
According to your study unit, what is the main reason that improved human relations skills may improve your grades?
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, 10.07.2019 09:00
question
Mathematics, 10.07.2019 09:00
Questions on the website: 13722367