Question: Consider the given Relational database schema for an Airlines application. The primary key of each relation is underlined. Flight (FlightNo) FlyON (Flight, NQ WeekDay) FlightLeg

Consider the given Relational database schema for an Airlines application. The primary key of each relation is underlined. Flight (FlightNo) FlyON (Flight, NQ WeekDay) FlightLeg (FlightNo, LegNo, DepartureTime, DepartureAirportCode, ArrivalTime, ArrivalAirport Code) FlightLegInstance (FightNo.LegNo.Date, ActualDepartureTime, ActualDepartureAirportCode, ActualArrivalTime, ActualArrivalAirportCode, AirplaneType, AirplaneNo) Airport (Airport Code AirportCity) AirplaneType (AirplaneType, ManufacturingCompany, SeatCapacity) Airplane (AirplaneType, AirplaneNo, ManufacturingYear, Status) CanLand (AirplaneType, AirportCode) FlightLegFares (FlightNo, LegNo, Class, Farevalue) Using DDL/DML of SQL2, write the appropriate statements to perform the following operations: a. Write a complete schema (you have to specify all necessary entity and referential constraints) for the table FlightLegInstance, Assume appropriate data types for the underlying attributes. b. Retrieve the total number of all flights that fly only on Sundays. C. List the flight number, day and time of all flights that depart from Cairo airport with destination JFK New York airport. The flights should be displayed in an ascending order according to day and time. d. Get all Airplane types that can land on "Hurgada" and "Sharm El-Sheikh" airports but not on "Luxor" airport. e. Define a view to get the total number of flying trips (flight leg instances) for each airplane during the last year (2006). Write a query to display such airplanes with more than 20 trips
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
