Question
Consider the following relational schema for the airport transfer database: airport ( a-code, name, capacity)
Consider the following relational schema for the airport transfer database:
airport ( a-code, name, capacity) <- a-code is primary key customer ( c-id, name, birth-year, address) <- c-id is primary key vehicle ( plate, capacity, driver-name) <- plate is primary key transfer( a-code, c-id, plate, year, ti-no) <- a-code, c-id, plate, year are primary key ticket ( ti-no, price) <- ti-no is primary key
Give the corresponding SQL queries for each of the following. (a) Find the vehicle plates, which are used in the transfers to "Esenboga" 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.
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started