Question: DATABASE SYSTEM QUESTION /SQL QUERIES Consider the following relational schema for the airport transfer database: airport ( a-code , name, capacity) customer ( c-id ,
DATABASE SYSTEM QUESTION /SQL QUERIES
Consider the following relational schema for the airport transfer database:
airport ( a-code, name, capacity)
customer ( c-id, name, birth-year, address)
vehicle ( plate, capacity, driver-name)
transfer( a-code, c-id, plate, year, ti-no)
ticket ( ti-no, price)
Give the corresponding SQL queries for each of the following. (a) Find the vehicle plates, which are used in the transfers to "Esenboa" Airport, and also have a driver whose name has at least five characters and starts with 'Z'. (b) List the airport codes with the total number of transfer tickets sold, and also total price. (c) Find the oldest customer's birth year and address, who have not bought any ticket yet. (d) Find the code and name of the airport with the 5th highest capacity. You can assume, for simplicity, that the capacity values are distinct. (e) Delete vehicles that have capacity lower than the average number of customers that are transferred by a vehicle in 2017.
NOTE: italic words represent primary keys.
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
