Download as docx, pdf, or txt
Download as docx, pdf, or txt
You are on page 1of 3

Lab 3

Part 1
1.
TABLE PRIMARY KEY FOREIGN KEY(S)
EMPLOYEE EMP_CODE JOB_CODE
BENEFIT EMP_CODE & PLAN_CODE EMP_CODE, PLAN_CODE
JOB PLAN_CODE NONE
PLAN JOB_CODE NONE

2.
TABLE INTEGRITY ENTITY EXPLANATION
EMPLOYEE Yes Each value of EMP_CODE is unique,
there are no nulls.
BENEFIT Yes Each combination of EMP_CODE and
PLAN_CODE value is unique, there are
no nulls.

JOB Yes Each value of JOB_CODE is unique,


there are no nulls.
PLAN Yes Each value of PLAN_CODE is Unique,
there are no nulls.

3.
TABLE REFERENTIAL ENTITY EXPLANATION

EMPLOYEE Yes Each JOB_CODE value in employee


points to existing JOB_CODE in Job
table.
BENEFIT Yes Each EMP_CODE value in Benefit
points to existing EMP_CODE in the
Employee table and each PLAN_CODE
value in the Benefit points to exiting
PLAN_CODE in the Plan Table.

JOB No
PLAN No

4. Crow’s Foot ERD of EMPLOYEE, BENEFITS, PLAN and JOB

(Is assigned to)

= JOB EMPLOYEE

(Has)

(Is found in)


PLAN BENEFIT
5. In the event that the primary key is absent, a secondary key—also referred to as a
replacement key—can be used to locate explicit data. For instance, a secondary key in the
Employee database is JOB CODE.

6. A composite key is a combination of at least two columns in a table that can be used to
specifically identify each row in a social information base. For instance, the EMP
LNAME and JOB CODE combination serves as the composite key in the Employee
table.

You might also like