Uploaded by elvismuneria

Assignment 1 (1)

advertisement
Database Management
Assignment 1
Use the database shown in Figure 1 to answer Problems 1-5.
1. For each table, identify the primary key and the foreign key(s). If a table does not have a
foreign key, write None.
2. Do the tables exhibit entity integrity? Answer yes or no, and then explain your answer.
3. Do the tables exhibit referential integrity? Answer yes or no, and then explain your answer.
Write NA (Not Applicable) if the table does not have a foreign key.
4. Describe the type(s) of relationship(s) between STORE and REGION.
5. Describe the type(s) of relationship(s) between EMPLOYEE and STORE.
Database Management
Use the database shown in Figure 2 to work Problems 6−8. Note that the database is
composed of four tables that reflect these relationships:
• An EMPLOYEE has only one JOB_CODE, but a JOB_CODE can be held by many
EMPLOYEEs.
• An EMPLOYEE can participate in many PLANs, and any PLAN can be assigned to many
EMPLOYEEs.
Note also that the M:N relationship has been broken down into two 1:M relationships for which
the BENEFIT table serves as the composite or bridge entity.
6. For each table in the database, identify the primary key and the foreign key(s). If a table does
not have a foreign key, write None.
7. Do the tables exhibit entity integrity? Answer yes or no, and then explain your answer.
8. Do the tables exhibit referential integrity? Answer yes or no, and then explain your answer.
Write NA (Not Applicable) if the table does not have a foreign key.
Use the database shown in Figure 3 to answer Problems 9-12.
Database Management
9. Do the tables exhibit entity integrity? Answer yes or no, and then explain your answer.
10. Do the tables exhibit referential integrity? Answer yes or no, and then explain your answer.
Write NA (Not Applicable) if the table does not have a foreign key.
11. Identify the TRUCK table’s candidate key(s).
12. For each table, identify a superkey and a secondary key.
Use the database shown in Figures 4 & 5 to answer Problems 13−16.
ROBCOR is an aircraft charter company that supplies on-demand charter flight services using a
fleet of four aircraft. Aircrafts are identified by a unique registration number. Therefore, the aircraft
registration number is an appropriate primary key for the AIRCRAFT table.
Database Management
Database Management
The nulls in the CHARTER table’s CHAR_COPILOT column indicate that a copilot is not required
for some charter trips or for some aircraft. Federal Aviation Administration (FAA) rules require
a copilot on jet aircraft and on aircraft having a gross take-off weight over 12,500 pounds. None
of the aircraft in the AIRCRAFT table are governed by this requirement; however, some customers
may require the presence of a copilot for insurance reasons. All charter trips are recorded in the
CHARTER table.
13. For each table, identify the primary key and foreign key(s) when possible.
You want to see data on charters flown by either Robert Williams (employee number105) or
Elizabeth Travis (employee number 109) as pilot or copilot, but not charters flown by both of them.
Complete Problems 14–16 to find this information.
14. Create the table that would result from applying the SELECT and PROJECT relational
operators to the CHARTER table to return only the CHAR_TRIP, CHAR_PILOT, and
CHAR_COPILOT attributes for charters flown by either employee 105 or employee 109.
15. Create the table that would result from applying the SELECT and PROJECT relational
operators to the CHARTER table to return only the CHAR_TRIP, CHAR_PILOT, and
CHAR_COPILOT attributes for charters flown by both employee 105 and employee 109.
16. Create the table that would result from applying a DIFFERENCE relational operator of your
result from Problem 14 to your result from Problem 15.
Download