Write sql select commands to answer the following


EXERCISES

1. Consider the following relational database that Best Airlines uses to keep track of its mechanics, their skills, and their airport locations. Mechanic number (MECHNUM), airport name (AIRNAME), and skill number are all unique fields SIZE is an airport's size in acres. SKILLCAT is a skill category, such as an engine skill, wing skill, tire skill, etc. YEARQUAL is the year that a mechanic first qualified in a particular skill; PROFRATE is the mechanic's proficiency rating in a particular skill.

MEXHANIC Table

MECHNUM

MECHNAME

AGE

SALLARY

AIRNAME

AIRPORT Table

AIRNAME

CITY

STATE

SIZE

YEAROPENED

SKILL Table

SKILLNUM

SKILLNAME

SKILLCAT

QUALIFICATION Table

MEXHNUM

SKILLNUM

YEARQUAL

PROFRATE

Write SQL SELECT commands to answer the following queries.

a. List the names and ages of all the mechanics.

b. List the airports in California that are at least 20 acres in size and have been open since 1935. Order the results from smallest to largest airport.

c. List the airports in California that are at least 20 acres in size or have been open since 1935.

d. Find the average size of the airports in California that have been open since 1935.

MINICASES

1. Consider the following relational database for Happy Cruise Lines. It keeps track of ships, cruises, ports, and passengers. A "cruise" is a particular sailing of a ship on a particular date. For example, the seven-day journey of the ship Pride of Tampa that leaves on June 13, 2011, is a cruise. Note the following facts about this environment.

• Both ship number and ship name are unique in the SHIP Table.

• A ship goes on many cruises over time. A cruise is associated with a single ship.

• A port is identified by the combination of port name and country.

• As indicated by the VISIT Table, a cruise includes visits to several ports and a port is typically included in several cruises.

• Both Passenger Number and Social Security Number are unique in the PASSENGER Table. A particular person has a single Passenger Number that is used for all the cruises she takes.

• The VOYAGE Table indicates that a person can take many cruises and a cruise, of course, has many passengers.

SHIP Table

SHIPNUM

SHIPNAME

BUILDER

IAUNCHDAIE

WEIGHT

CRUISE Table

CRUISENUM

STARTDATE

ENODATE

DIRECTOR

SHIPNUM

PORT Table

PORTNAME

COUNTRY

NUMDOCKS

MANAGER

VISIT Table

CRUISENUM

PORTNAME

COUNTRY

ARRDATE

DEPDATE

PASSENGER Table

PASSENGERNUM

PASSENGERNAME

SOCSECNUM

STATE

COUNTRY

VOYAGE Table

PASSENGERNUM

CRUISENUM

ROOMNUM

FARE

Write SQL SELECT commands to answer the following queries.

a. Find the start and end dates of cruise number 35218.

b. List the names and ship numbers of the ships built by the Ace Shipbuilding Corp. that weigh more than 60,000 tons.

c. List the companies that have built ships for Happy Cruise Lines.

d. Find the total number of docks in all the ports in Canada.

e. Find the average weight of the ships built by the Ace Shipbuilding Corp. that have been launched since 2000.

f. How many ports in Venezuela have at least three docks?

g. Find the total number of docks in each country. List the results in order from most to least. It Find the total number of ports in each country.

i. Find the total number of docks in each country but include only those countries that have at least twelve docks in your answer.

j. Find the name of the ship that operated on (was used on) cruise number 35218.

k. List the names, states and countries of the passengers who sailed on The Spirit of Nashville on cruises that began during July, 2011.

l. Find the names of the company's heaviest ships.

m. Find the names of the company's heaviest ships that began a cruise between July 15, 2011 and July 31, 2011.

Solution Preview :

Prepared by a verified Expert
Database Management System: Write sql select commands to answer the following
Reference No:- TGS02170627

Now Priced at $40 (50% Discount)

Recommended (95%)

Rated (4.7/5)