Academic Integrity: tutoring, explanations, and feedback — we don’t complete graded work or submit on a student’s behalf.

Consider the given Relational database schema for an Airlines application. The p

ID: 3842339 • Letter: C

Question

Consider the given Relational database schema for an Airlines application. The primary key of each relation is underlined. Flight (FlightNo) FlyON (FlightNQ, WeekDay) FlightLeg (FightNo, LegNo, DepartureTime, DepartureAirportCode, ArrivalTime, ArrivalAirportCode) FlightLeglnstance (FightNo, LegNo, Date, ActualDepartureTime, ActualDepartureAirportCode, ActualArrivaltime, ActualArrivalAirportCode, AirplaneType, AirplaneNo) Airport (AirportCode, 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. 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 200 trips. Consider again the same Relational database schema for the Airlines application with all the tables and views are already created. Suppose that Moustafa is the DBA of this database and he wants to grant the following privileges to users' accounts Eman, Wael, Sherif, and Menna. Write SQL statements to grant these privileges: Account Eman can retrieve and modify all information of Flight, FlyOn, and FlightLeg. Account Wael can retrieve only the FlightLegInstances' data of only those departing from Cairo airport. Account Sherif can only modify the Farevalue of FlightLegFare. Account Menna, can only get the total number of flying trips (flight leg instances) for each airplane during the last year (2006).

Explanation / Answer

import java.util.Scanner; public class Airline { boolean[] seating = new boolean[11]; /* create 10 seat numbers (array[0] will not be used). Empty seat indicated by false*/ Scanner input = new Scanner(System.in); public void start() { while ( true ) { makeReservation(); } } public void makeReservation() { System.out.println("Please type 1 for First Class or 2 for Economy: "); int section = input.nextInt(); if ( section == 1 ) { firstClassSeat(); } else { economySeat(); } } public void firstClassSeat() // assign a first class seat { for ( int count = 1; count