0% found this document useful (0 votes)
52 views3 pages

DuongTrungKien SE180067 Lab2

1. The relation Invoice is not in 3NF as the functional dependency A -> BCDE violates the 3NF rules. 2. To decompose the relation into 3NF, it is split into four relations: R1(OrderID, OrderDate, CustomerID), R2(CustomerID, CustomerName, CustomerAddress), R3(ProductID, ProductDescription, ProductStandardPrice), R4(OrderID, ProductID, OrderedQuantity). 3. The relation Tech is initially decomposed into three relations to satisfy 2NF, then further decomposed into five relations to satisfy 3NF.

Uploaded by

tronglmse180005
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
52 views3 pages

DuongTrungKien SE180067 Lab2

1. The relation Invoice is not in 3NF as the functional dependency A -> BCDE violates the 3NF rules. 2. To decompose the relation into 3NF, it is split into four relations: R1(OrderID, OrderDate, CustomerID), R2(CustomerID, CustomerName, CustomerAddress), R3(ProductID, ProductDescription, ProductStandardPrice), R4(OrderID, ProductID, OrderedQuantity). 3. The relation Tech is initially decomposed into three relations to satisfy 2NF, then further decomposed into five relations to satisfy 3NF.

Uploaded by

tronglmse180005
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
You are on page 1/ 3

Lab 2 : Functional dependency and Normal Form

1,Consider the relation and the appropriate functional dependencies are listed below, indicate the normal
form for that relation. If the relation is not in third normal form, decompose it into the 3NF relation.

- OrderID: A, OrderDate:B, CustomerID: C, CustomerName: D, CustomerAddress: E,


ProductID: F, ProductDescription: G, ProductStandardPrice: H, OrderedQuantity: I
- Invoice(A,B,C,D,E,F,G,H,I)
- FD’s: A -> BCDE, C -> DE, F -> GH, AF -> I
- {AF}+ = AFBCDEGHI
TechNo TechName DeptId Department JobNo Date SchoolID School Hoursworked
298 Walls, Ian 1 Engineering 1002 12/9/07 192 Beauty 2.5
298 Walls, Ian 1 Engineering 1003 12/9/07 125 Computing 5.5
345 Smith, Alan 2 Helpdesk 1002 12/9/07 192 Beauty 3
345 Smith, Alan 2 Helpdesk 3440 18/9/07 346 Bus & Man 1.5
345 Smith, Alan 2 Helpdesk 1480 15/9/07 192 Beauty 3
380 Jackson, Bob 3 Labs 3670 19/9/07 560 Design 4
380 Jackson, Bob 3 Labs 3440 18/9/07 346 Bus & Man 2
300 Jones, Joe 2 Helpdesk 1450 15/9/07 125 Computing 1
300 Jones, Joe 2 Helpdesk 1480 15/9/07 192 Beauty 3
320 Young, Jill 3 Labs 3440 18/9/07 346 Bus & Man 4
320 Young, Jill 3 Labs 1002 12/9/07 192 Beauty 2.5
320 Young, Jill 3 Labs 3670 19/9/07 560 Design 2

- => {AF} is a key.


- => Minimal basis: A -> BC, C -> DE, F -> GH, AF -> I
- => Not 3NF (A -> BC: A is not a key).
- => New relaion: R1(A,B,C), R2(CDE), R3(FGH), R4(AFI)
- R1(OrderID, OrderDate, CustomerID)
- R2(CustomerID, CustomerName, CustomerAddress)
- R3(ProductID, ProductDescription, ProductStandardPrice)
2,

-
TechNo: A, TechName: B, DeptId: C, Department: D, JobNo: E, Date: F, SchoolID: G, School: H,
Hoursworked: I
=> FD’s: A -> BC, C -> D, E -> FG, G -> H, AE -> I
=> Key: {AE}.
=> Already 1NF.

=> 2NF: R1(A,B,C,D), R2(E,F,G,H), R3(A,E,I)

TechNo TechName DeptId Department


298 Walls, Ian 1 Engineering
345 Smith, Alan 2 Helpdesk
380 Jackson, Bob 3 Labs
300 Jones, Joe 2 Helpdesk
320 Young, Jill 3 Labs
R1

JobN SchoolI School


o Date D
1002 12/9/07 192 Beauty
1003 12/9/07 125 Computing
3440 18/9/07 346 Bus & Man
1480 15/9/07 192 Beauty
3670 19/9/07 560 Design
1450 15/9/07 125 Computing
R2

TechN
o JobNo Hoursworked
298 1002 2.5
298 1003 5.5
345 1002 3
345 3440 1.5
345 1480 3
380 3670 4
380 3440 2
300 1450 1
300 1480 3
=>3NF: R1(A,B,C), R2(E,F,G), R3(A,E,I), R4(C,D), 320 3440 4
R5(G,H) 320 1002 2.5
320 3670 2
TechNo TechName DeptId R3
298 Walls, Ian 1
TechNo JobNo Hoursworked
298 1002 2.5
298 1003 5.5
345 Smith, Alan 2 345 1002 3
380 Jackson, Bob 3 345 3440 1.5
300 Jones, Joe 2 345 1480 3
320 Young, Jill 3 380 3670 4
380 3440 2
R1 300 1450 1
300 1480 3
JobNo Date SchoolID 320 3440 4
1002 12/9/07 192 320 1002 2.5
1003 12/9/07 125 320 3670 2
3440 18/9/07 346 R3
1480 15/9/07 192
3670 19/9/07 560
1450 15/9/07 125
R2

DeptI SchoolID School


d Department 192 Beauty
1 Engineering
2 Helpdesk 125 Computing
3 Labs 346 Bus & Man
R4 Design
560
R5

You might also like