Question: The current database is shown in outline notation below. AIRLINE ( AirlineID , AirlineName ) FLIGHT ( TripID , Year, Month, Day, DayOfWeek, AirlineID, FlightNum,
The current database is shown in outline notation below.
AIRLINE AirlineID AirlineName
FLIGHTTripID Year, Month, Day, DayOfWeek, AirlineID, FlightNum, OrigAirport, DestAirport, DepartPlan, DepartDelay, TimePlan, TimeElapsed, TimeInAir, Distance, ArrivalPlan, ArrivalDelay
OrigAirport foreign key to AIRPORT
DestAirport foreign key to AIRPORT
AIRPORTAirportID AirportName, StateAbbr, County, City, Longitude, Latitude
StateAbbr foreign key to STATE
STATE StateAbbr StateName
According to this design, write SQL queries to display the information for each of the following questions for the queries that need "join" operations, use the Cartesian join
pts Show the airline ID the origin airport ID the scheduled departure time, the departure delay in minutes, the time elapsed for the trip, the arrival delay in minutes, and the route distance. The output should be sorted by the airline ID in ascending order first; then by the origin airport ID in descending order.
pts Show the same information as part a but only for trips that have routes longer than or equal to miles and shorter than or equal to miles.
pts Show the same information as part b replacing the origin airport ID with the airport name. The same sorting rule is applied to the output: by airline ID and then by the airport ID
pts Show the airline name, the days of week, and the average of the departure delay time in minutes, grouping by the days of week and the airline name without sorting.
pts Show the same information as part d and the average of the route distances naming this field as AvgDist applying the same grouping and sorting rules, but only for the trips that depart from the airports whose longitudes are greater than and whose latitudes are greater ; and that have routes longer than or equal to miles.
pts Show the same information as part e whose resulted rows have the average of the departure delay time greater than or equal to minutes.
Step by Step Solution
There are 3 Steps involved in it
1 Expert Approved Answer
Step: 1 Unlock
Question Has Been Solved by an Expert!
Get step-by-step solutions from verified subject matter experts
Step: 2 Unlock
Step: 3 Unlock
