0% found this document useful (0 votes)
22 views

DBMS Assignment1

Here is the ERD showing the relationships among the tables: [ERD IMAGE] The ERD shows: - EMPLOYEE and JOB are in a one-to-many relationship, as an employee can only have one job but a job can have multiple employees - EMPLOYEE and PLAN are in a many-to-many relationship, broken into two one-to-many relationships through the BENEFIT table - BENEFIT connects EMPLOYEE and PLAN in a many-to-many relationship

Uploaded by

abhi404171
Copyright
© © All Rights Reserved
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
22 views

DBMS Assignment1

Here is the ERD showing the relationships among the tables: [ERD IMAGE] The ERD shows: - EMPLOYEE and JOB are in a one-to-many relationship, as an employee can only have one job but a job can have multiple employees - EMPLOYEE and PLAN are in a many-to-many relationship, broken into two one-to-many relationships through the BENEFIT table - BENEFIT connects EMPLOYEE and PLAN in a many-to-many relationship

Uploaded by

abhi404171
Copyright
© © All Rights Reserved
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
You are on page 1/ 3

Assignment 1 - Chapter 3

Use the database shown in Figure P3.10 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.

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.

Ans:

Table: EMPLOYEE Table: JOB


Primary Key: EMP_CODE Primary Key: JOB_CODE
Foreign Key: JOB_CODE Foreign Key: None

Table: BENEFIT Table: PLAN


Primary Key: EMP_CODE+PLAN_CODE Primary Key: PLAN_CODE
Foreign Key: EMP_CODE, PLAN_CODE Foreign Key: None
13. Do the tables exhibit entity integrity? Answer yes or no, and then explain your answer.

Ans:

Table: EMPLOYEE
Yes, the table exhibits entity integrity. As there are no null values present in the table represented above,
they exhibit entity integrity.

Table: BENEFIT
Yes, the table exhibits entity integrity. As there are no null values present in the table represented above,
they exhibit entity integrity.

Table: JOB
Yes, the table exhibits entity integrity. As there are no null values present in the table represented above,
they exhibit entity integrity.

Table: PLAN
Yes, the table exhibits entity integrity. As there are no null values present in the table represented above,
they exhibit entity integrity.

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.

Ans:

Table: EMPLOYEE
Yes, the table exhibits referential integrity. As the foreign key contains value matching the primary key of
Table: JOB.

Table: BENEFIT
Yes, the table exhibits referential integrity. As the foreign key contains value matching the primary key of
Table: EMPLOYEE & PLAN.

Table: JOB
NA. No, the table does not exhibit referential integrity. As there is no foreign key present in the table
represented above.

Table: PLAN
NA. No, the table does not exhibit referential integrity. As there is no foreign key present in the table
represented above.
15. Create the ERD to show the relationships among EMPLOYEE, BENEFIT, JOB, and PLAN.

You might also like