Question: need help with this question, in SQL please Question 2. [50 marks] The following relational database scheme keeps track of airline flight information: FLIGHTS (flightNumber,
need help with this question, in SQL please
Question 2. [50 marks] The following relational database scheme keeps track of airline flight information: FLIGHTS (flightNumber, from, to, distance, departs, arrives, price) AIRCRAFT (ald, aName, cruisingRange) CERTIFIED (eld, ald, date) EMPLOYEES (eld, SSN, firstName, lastName, salary, phone, address, city, province) PILOTS (eld, startDate, endDate) FLIGHT_ATTENDANTS (eld, startDate, endDate) Note that the Employees relation describes pilots and other kinds of employees as well; every pilot is certified for some aircraft, and only pilots are certified to fly. endDate is set to null if the employee is still working. Write each of the following queries in SQL (a to f7 points & g 8 points): Find the aircraft names and cruisingRanges of aircrafts such that all pilots certified to operate them earn more than 95,000S a. b. Find the detail (eld, SSN, firstName, lastName, salary, phone, address, city, province, startDate and endDate) of pilots certified for at least four different aircrafts. Find the detail (eld, SSN, firstName, lastName, salary, phone, address, city, province, startDate and endDate) of pilots who are not currently working and are certified for Boeing 747 and Airbus 360 aircrafts. c. Find the firstName and lastName of pilots whose salary is less than the price of the cheapest route from Montreal to Paris. d. Find the firstName and lastName of pilots who can operate planes with cruisingRange greater than 5000 miles, but are not certified on any Boeing aircraft. e. f. Compute the difference between the average salary of a pilot and the average salary of all employees (including pilots). g. Find the firstName and lastName of pilots who are certified to operate all aircrafts. Question 2. [50 marks] The following relational database scheme keeps track of airline flight information: FLIGHTS (flightNumber, from, to, distance, departs, arrives, price) AIRCRAFT (ald, aName, cruisingRange) CERTIFIED (eld, ald, date) EMPLOYEES (eld, SSN, firstName, lastName, salary, phone, address, city, province) PILOTS (eld, startDate, endDate) FLIGHT_ATTENDANTS (eld, startDate, endDate) Note that the Employees relation describes pilots and other kinds of employees as well; every pilot is certified for some aircraft, and only pilots are certified to fly. endDate is set to null if the employee is still working. Write each of the following queries in SQL (a to f7 points & g 8 points): Find the aircraft names and cruisingRanges of aircrafts such that all pilots certified to operate them earn more than 95,000S a. b. Find the detail (eld, SSN, firstName, lastName, salary, phone, address, city, province, startDate and endDate) of pilots certified for at least four different aircrafts. Find the detail (eld, SSN, firstName, lastName, salary, phone, address, city, province, startDate and endDate) of pilots who are not currently working and are certified for Boeing 747 and Airbus 360 aircrafts. c. Find the firstName and lastName of pilots whose salary is less than the price of the cheapest route from Montreal to Paris. d. Find the firstName and lastName of pilots who can operate planes with cruisingRange greater than 5000 miles, but are not certified on any Boeing aircraft. e. f. Compute the difference between the average salary of a pilot and the average salary of all employees (including pilots). g. Find the firstName and lastName of pilots who are certified to operate all aircrafts
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
