CSC263 Lab2
CSC263 Lab2
cs.salemstate.edu
CSC263: Lab 02
Requirements:
Part 1:
Figure 1
1. From Figure 1, for each table, identify the primary key and the foreign key(s). If a table does not have a
foreign key, write None in the space provided.
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.
5. Create the ERD to show the relationship between STORE and REGION.
6. Create the relational diagram to show the relationship between STORE and REGION.
7. Describe the type(s) of relationship(s) between EMPLOYEE and STORE. (Hint: Each store employs many
employees, one of whom manages the store.)
8. Draw the ERD to show the relationships among EMPLOYEE, STORE, and REGION.
9. Create the relational diagram to show the relationships among EMPLOYEE, STORE, and REGION.
Part 2:
Use the database shown in Figure 2 to work Problems 10−16. 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.
Computer Science Department
cs.salemstate.edu
Figure 2
10. 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 in the assigned space provided.
11. Create the ERD to show the relationship between EMPLOYEE and JOB.
12. Create the relational diagram to show the relationship between EMPLOYEE and JOB.
13. Do the tables exhibit entity integrity? Answer yes or no and then explain your answer.
14. 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.
15. Create the ERD to show the relationships among EMPLOYEE, BENEFIT, JOB, and PLAN.
16. Create the relational diagram to show the relationships among EMPLOYEE, BENEFIT, JOB, and PLAN.