csci 4333 database design and implementation – exercise (3) xiang lian the university of texas –...
TRANSCRIPT
![Page 1: CSCI 4333 Database Design and Implementation – Exercise (3) Xiang Lian The University of Texas – Pan American Edinburg, TX 78539 lianx@utpa.edu 1](https://reader035.vdocument.in/reader035/viewer/2022072015/56649eb55503460f94bbe47f/html5/thumbnails/1.jpg)
1
CSCI 4333 Database Design and Implementation – Exercise (3)
Xiang Lian
The University of Texas – Pan American
Edinburg, TX 78539
![Page 2: CSCI 4333 Database Design and Implementation – Exercise (3) Xiang Lian The University of Texas – Pan American Edinburg, TX 78539 lianx@utpa.edu 1](https://reader035.vdocument.in/reader035/viewer/2022072015/56649eb55503460f94bbe47f/html5/thumbnails/2.jpg)
Functional Dependency
• Given a schema R = (A, B, C, G, H, I) and a set of functional dependencies: F = {A B A C CG H
CG I B H}• Please prove that the following functional dependencies are in F+:
A HAG ICG HI
2
![Page 3: CSCI 4333 Database Design and Implementation – Exercise (3) Xiang Lian The University of Texas – Pan American Edinburg, TX 78539 lianx@utpa.edu 1](https://reader035.vdocument.in/reader035/viewer/2022072015/56649eb55503460f94bbe47f/html5/thumbnails/3.jpg)
Attribute Closure
• Given a schema R = (A, B, C, G, H, I) and a set of functional dependencies:
F = { A BA C CG HCG IB H}
• Please compute attribute closure (AG)+
• Is AG a candidate key?
3
![Page 4: CSCI 4333 Database Design and Implementation – Exercise (3) Xiang Lian The University of Texas – Pan American Edinburg, TX 78539 lianx@utpa.edu 1](https://reader035.vdocument.in/reader035/viewer/2022072015/56649eb55503460f94bbe47f/html5/thumbnails/4.jpg)
Lossless Decomposition & Dependency Preserving
• R = (A, B, C) F= {A B, B C}
• Is the decomposition of R into R1 = (A, B) and R2 = (B, C) lossless? Dependency preserving?
• How about R1 = (A, B), R2 = (A, C)?
4
![Page 5: CSCI 4333 Database Design and Implementation – Exercise (3) Xiang Lian The University of Texas – Pan American Edinburg, TX 78539 lianx@utpa.edu 1](https://reader035.vdocument.in/reader035/viewer/2022072015/56649eb55503460f94bbe47f/html5/thumbnails/5.jpg)
Boyce-Codd Normal Form (BCNF)
• R = (A, B, C)F = {A B
B C}• Is R in BCNF? Why? (Hint: Key = {A})• How to decompose R if R is not in BCNF?
5
![Page 6: CSCI 4333 Database Design and Implementation – Exercise (3) Xiang Lian The University of Texas – Pan American Edinburg, TX 78539 lianx@utpa.edu 1](https://reader035.vdocument.in/reader035/viewer/2022072015/56649eb55503460f94bbe47f/html5/thumbnails/6.jpg)
Third Normal Form (3NF)
• R = (J, K, L)F = {JK L, L K}
• Is R in 3NF? Why? (Hint: Two candidate keys: JK and JL)
6
![Page 7: CSCI 4333 Database Design and Implementation – Exercise (3) Xiang Lian The University of Texas – Pan American Edinburg, TX 78539 lianx@utpa.edu 1](https://reader035.vdocument.in/reader035/viewer/2022072015/56649eb55503460f94bbe47f/html5/thumbnails/7.jpg)
Minimal Cover
• Find a minimal cover of the following set of FDs:– ABCD– BCFG– AG– GB– CG
• Is the decomposition of ABCDFG into ABCD and ACFG lossless? Explain.
7
![Page 8: CSCI 4333 Database Design and Implementation – Exercise (3) Xiang Lian The University of Texas – Pan American Edinburg, TX 78539 lianx@utpa.edu 1](https://reader035.vdocument.in/reader035/viewer/2022072015/56649eb55503460f94bbe47f/html5/thumbnails/8.jpg)
8