


Study with the several resources on Docsity
Earn points by helping other students or get them with a premium plan
This page cannot be seen from the preview
Don't miss anything!



ย Open book, open notes ย Sample midterm (from last year) available
3
ย Functional dependencies ย X โ Y: If two rows agree on X, they must agree on Y )A generalization of the key concept
ย Non-key functional dependencies: a source of redundancy ย Non-trivial X โ Y where X is not a superkey )Called a BCNF violation
ย BCNF decomposition: a method for removing redundancies ย Given R(X, Y, Z) and a BCNF violation X โ Y, decompose R into R 1 (X, Y) and R 2 (X, Z) )A lossless join decomposition
ย Schema in BCNF has no redundancy due to FDโs
4
5
ย street_address, city, state โ zip ย zip โ city, state
ย {street_address, city, state} ย {street_address, zip}
ย Violation: zip โ city, state
6
Address 1 (zip, city, state) Address 2 (street_address, zip) ย FDโs in Address 1 ย zip โ city, state ย FDโs in Address 2 ย None! ย Hey, where is street_address, city, state โ zip? ย Cannot check without joining Address 1 and Address 2 back together ย Problem: Some lossless join decomposition is not dependency-preserving ย Dilemma: Should we get rid of redundancy at the expense of making constraints harder to enforce?
ย R is in Third Normal Form (3NF) if for every non-trivial FD X โ A (where A is single attribute), either ย X is a superkey of R, or ย A is a member of at least one key of R )Intuitively, BCNF decomposition on X โ A would โbreakโ the key containing A
ย So Address is already in 3NF
ย Tradeoff: ย Can enforce all original FDโs on individual decomposed relations ย Might have some redundancy due to FDโs
ย Suppose your classes have nothing to do with the clubs you join ย FDโs?
SID CID club 142 CPS116 ballet 142 CPS116 sumo 142 CPS114 ballet 142 CPS114 sumo 123 CPS116 chess 123 CPS116 golf ... ... ...
9
X Y Z a b1 c a b2 c ... ... ...
X Y Z a b1 c a b2 c a b1 c a b2 c ... ... ...
Must be in R too
10
ย Intuition: given SID, CID and club are โindependentโ
ย Trivial: LHS โช RHS = all attributes of R
ย Trivial: LHS โ RHS
11
ย FD reflexivity, augmentation, and transitivity ย MVD complementation: If X Y, then X attrs(R) โ X โ Y ย MVD augmentation: If X Y and V โ W, then XW YV
ย MVD transitivity: If X Y and Y Z, then X Z โ Y ย Replication (FD is MVD): If X โ Y, then X Y ย Coalescence: If X Y and Z โ Y and there is some W disjoint from Y such that W โ Z, then X โ Z
Try proving things using these!
12
ย Start with the hypothesis of d, and treat them as โseedโ tuples in a relation ย Apply the given dependencies in D repeatedly
ย 1NF: All column values must be atomic ย 2NF: There is no partial functional dependency (a non- trivial FD X โ A where X is a proper subset of some key)
Redundancy due to MVDโs Possible Possible No
Redundancy due to FDโs Possible No No
Lose FDโs? No Possible Possible
Anomaly/normal form 3NF BCNF 4NF