1. Which destination in the flights database is the fur

Added on -2019-09-23

| 2 pages
| 515 words
| 441 views

Trusted by 2+ million users,
1000+ happy students everyday

Showing pages 1 to 1 of 2 pages

1. Which destination in the flights database is the furthest distance away, based on information in the flights table. Show the SQL query(s) that support your conclusion.Query - SELECT DISTINCT carrier, flight, origin, dest, distance FROM flights WHERE distance = (SELECT MAX(distance) FROM flights);Output - ‘HA','51','JFK','HNL','4983'Therefore, the furthest distance destination is HNL which is Honolulu International airport.2. What are the different numbers of engines in the planes table? For each number of engines, which aircraft have the most number of seats? Show the SQL statement(s) that support your result.Query - SELECT engine FROM planes GROUPBY engine;Output - 4 Cycle Reciprocating Turbo-fan Turbo-jet Turbo-prop Turbo-shaft Therefore, there are 6 different numbers of engines in the plane tableQuery - SELECT DISTINCT model, seats FROM planes WHERE engine = 'Turbo-fan' AND seats = (SELECT MAX(seats) FROM planes WHERE engine = 'Turbo-fan');Output - ‘777-222,'400' , ’777-224,'400'Therefore, aircraft 777-222 and 777-224 has the most number of seats i.e. 400 for engine Turbo-fan.Query - SELECT DISTINCT model, seats FROM planes WHERE engine = 'Turbo-jet' AND seats =(SELECT max(seats) FROM planes WHERE engine = 'Turbo-jet');Output - ‘747-451,'450'Therefore, aircraft 747-451 has the most number of seats i.e. 450 for engine Turbo-jet.Query - SELECT DISTINCT model, seats FROM planes WHERE engine = 'Turbo-prop' AND seats= (SELECT max(seats) FROM planes WHERE engine = 'Turbo-prop');

Found this document preview useful?

You are reading a preview
Upload your documents to download
or
Become a Desklib member to get accesss

Students who viewed this