Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

QUESTION 4 Consider a database of flight departures and airplanes, with the following schema: Departure ( departureID , airplaneID,destination,departureTime,bookedSeats ) Airplane ( airplaneID , modelID,fabricationYear

QUESTION 4
Consider a database of flight departures and airplanes, with the following schema:
Departure(departureID, airplaneID,destination,departureTime,bookedSeats)
Airplane(airplaneID,modelID,fabricationYear)
Model(ModelID,name,capacity)
Primary keys are underlined. Write SQL queries to answer the following:
(a) Write an SQL query that lists the airplaneID of all airplanes made before 1960.
(5 marks)
(b) Write an SQL query that lists the departureID for all departures bounded for destinations starting with the letter "D".
(6 marks)
(c) Write an SQL query that lists the average capacity of airplanes fabricated 1970 or later.
(7 marks)
(d) Write an SQL query that lists the departureID for every overbooked departure (i.e. where the number of bookings exceed the capacity of the plane).
image text in transcribed

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Database Systems Introduction To Databases And Data Warehouses

Authors: Nenad Jukic, Susan Vrbsky, Svetlozar Nestorov

1st Edition

1943153191, 978-1943153190

More Books

Students also viewed these Databases questions