Presentation is loading. Please wait.

Presentation is loading. Please wait.

Assignment 5–2 For each table, Give a meaningful name

Similar presentations


Presentation on theme: "Assignment 5–2 For each table, Give a meaningful name"— Presentation transcript:

1 Assignment 5–2 For each table, Give a meaningful name
Use DBDL to specify the relation scheme Give the functional dependencies Give the corresponding table instance

2 Assignment 5–2 StaffProjHours (NIN, ContractNo, eName, hours, hNo, hLoc) PK: NIN, ContractNo AK: None FK: None FDs: NIN ===> eName hNo ===> hLoc ContractNo ===> hNo, hLoc NIN, ContractNo ===> eName, hNo, hLoc, hours Not in 2NF How many tables (relations)? Staff: NIN ===> eName Contract: ContractNo ===> hNo, hLoc StaffProjHours : NIN, ContractNo ===> hours

3 Assignment 5–2 2NF Staff (NIN, eName) PK: NIN AK: NONE FK: NONE FDs:
Table (Relation) Instance (Remove duplicate records) NIN eName 1135 Smith J 1057 Hocine D White T Smith J

4 Assignment 5–2 2NF Contract (ContractNo, hNo, hLoc) PK: ContractNo
AK: NONE FK: NONE FDs: ContractNo ===> hNo, hLoc hNo ===> hLoc Table (Relation) Instance (Remove duplicate records) ContractNo hNo hLoc C H East Kilbride C H Glasgow C H East Kilbride C H East Kilbride

5 Assignment 5–2 2NF StaffProjHours (NIN, ContractNo, hours)
PK: ContractNo, NIN AK: NONE FK: NIN References Staff ContractNo References Contract FDs: NIN, ContractNo ===> hours Table (Relation) Instance NIN ContractNo hours C C C C C

6 Assignment 5–2 Not in 3NF Contract (ContractNo, hNo, hLoc)
PK: ContractNo AK: NONE FK: NONE FDs: ContractNo ===> hNo, hLoc hNo ===> hLoc How many tables? Hotel (hNo, hLoc) Contract (ContractNo, hNo)

7 Assignment 5 – Part II 3NF Hotel (hNo, hLoc) PK: hNo AK: NONE FK: NONE
FDs: hNo ===> hLoc Table (Relation) Instance hNo hLoc H Glasgow H East Kilbride H East Kilbride

8 Assignment 5 – Part II 3NF Contract (ContractNo, hNo) PK: ContractNo
AK: NONE FK: hNo References Hotel FDs: ContractNo ===> hNo Table (Relation) Instance ContractNo hNo C H25 C H24 C H25 C H29

9 Assignment 5–2 List the names of all tables of your final result.
(not relationships!) Staff Hotel Contract StaffProjHours

10 Style NIN eName 1135 Smith J 1057 Hocine D 1068 White T NIN ContractNo
Staff (NIN, eName) PK: NIN AK: None FK: None FD: NIN ===> eName Table Instance StaffProjHours (NIN, ContractNo, hours) PK: NIN, ContractNo AK: None FK: NIN References Staff ContractNo References Contract FD: NIN, ContractNo ===> hours Table Instance NIN eName 1135 Smith J 1057 Hocine D 1068 White T NIN ContractNo hours 1135 C1024 16 1057 24 1068 C1025 28 15

11 Style Staff (NIN, eName) PK: NIN AK: None FK: None FD:
Table Instance NIN eName Smith J Hocine D White T StaffProjHours (NIN, ContractNo, hours) PK: NIN, ContractNo AK: None FK: NIN References Staff ContractNo References Contract FD: NIN, ContractNo ===> hours Table Instance NIN ContractNo hours C C C C

12 Meaningful Table Names
Staff (NIN, eName) Patient (NIN, eName) Hotel (hNo, hLoc) Hospital (hNo, hLoc)


Download ppt "Assignment 5–2 For each table, Give a meaningful name"

Similar presentations


Ads by Google