Professional Documents
Culture Documents
Attribute & FD Closure
Attribute & FD Closure
Attribute & FD Closure
9/21/2010
9/21/2010
9/21/2010
9/21/2010
9/21/2010
9/21/2010
Example
R = (A, B, C, G, H, I) F={ ApB ApC CG p H CG p I B p H} some members of F+ ApH by transitivity from A p B and B p H AG p I by augmenting A p C with G, to get AG p CG and then transitivity with CG p I CG p HI 9/21/2010 By union rule
9/21/2010
10
9/21/2010
11
There are several uses of the attribute closure algorithm: Testing for superkey: To test if E is a superkey, we compute E+, and check if E+ contains all attributes of R. Testing functional dependencies To check if a functional dependency E p F holds (or, in other words, is in F+), just check if F E+. That is, we compute E+ by using attribute closure, and then check if it contains F. Is a simple and cheap test, and very useful Computing closure of F For each K R, we find the closure K+, and for each S K+, we output a functional dependency K p S. 9/21/2010
12