Examlex
Consider the following relational database for Grand Travel Airlines.
Grand Travel Airlines has to keep track of its flight and airplane history. A flight is uniquely identified by the combination of a flight number and a date. Every passenger who has flown on Grand Travel has a unique passenger number. For a particular passenger who has taken a particular flight, the company wants to keep track of the fare that she paid for it and the date that she made the reservation for it. Clearly, a passenger may have taken many flights (he must have taken at least one to be in the database) and every flight has had many passengers on it.
A pilot is identified by a unique pilot (or employee) number. A flight on a particular date has exactly one pilot. Each pilot has typically flown many flights but a pilot may be new to the company, is in training, and has not flown any flights, yet. Each airplane has a unique serial number. A flight on a particular date used one airplane. Each airplane has flown on many flights and dates, but a new airplane may not have been used at all, yet.
PILOT Relation
FLIGHT Relation
PASSENGER Relation
RESERVATION Relation
AIRPLANE Relation
Write SQL SELECT commands to answer the following queries.
a. Find the records for the airplanes manufactured by Boeing.
b. How many reservations are there for flight 278 on February 21, 2004?
c. List the flights on March 7, 2004 that are scheduled to depart between 10 and 11AM or that are scheduled to arrive after 3PM on that date.
d. How many Boeing 737s does Grand Travel have?
e. How many of each model of Boeing aircraft does Grand Travel have?
f. List the names and dates of hire of the pilots who flew Airbus A320 aircraft in March, 2004.
g. List the names, addresses, and telephone numbers of the passengers who have reservations on Flight 562 on January 15, 2004.
h. What was the total fare paid for each flight scheduled to depart between 9 and 10AM on December 23, 2003? Only include those flights for which the total fare was at least $5,000.
i. List the smallest (in terms of passenger capacity) Boeing 737s.
j. List the Airbus A310s that are larger (in terms of passenger capacity) than the smallest Boeing 737s.
Infant Son
A male child in the earliest period of life, typically before he begins to walk or talk.
Pounds
A unit of weight commonly used in the United States and the British Commonwealth, equal to 0.453592 kilograms.
Calories
Units of energy used to measure the energy content in food and beverages.
Obesity
A medical condition characterized by excessive body fat that presents health risks, including cardiovascular diseases, diabetes, and hypertension.
Q19: Database management systems are expected to handle
Q23: Passwords should not be so difficult to
Q26: All of the following are corporate resources,
Q32: When a negative amount is in the
Q36: Assume that the records of the Animal
Q48: A one-to-one unary relationship involves a single
Q60: A relational query optimizer is a separate
Q81: The gain or loss from retirement of
Q194: Financial information for Sigma Company is presented
Q224: The current year-end balance sheet data for