1 Classroom Exercise: Normalization u Consider the relation R(A,B,C,D) with these given FDs: w AB -> C w C -> D w D -> A u Compute all nontrivial FDs that follow from these. u Compute the key(s) for R. u What are all the superkeys? u What are all the BCNF violations? u Decompose R into BCNF. u What are all the 3NF violations (before decomposing into BCNF)? u Decompose R into 3NF.
2 Normalization Example uConsider relation R(name, SSN, BD, childName, childSSN, childBD, VIN, make) uAssume these FDs: wSSN -> name BD wchildSSN -> childName childBD wVIN -> make uTherefore key is {SSN,childSSN,VIN} and all FDs violate BCNF. uAssume these MVDs: wSSN ->-> childSSN childName childBD wSSN ->-> VIN make uThus all MVDs violate 4NF.
3 Normalization Ex. cont'd uDecompose R using SSN ->-> childSSN childName childBD: wR1(SSN,childSSN,childName,childBD) wR2(SSN,name,BD,VIN,make) uDecompose R2 using SSN ->-> VIN make: wR2.1(SSN,VIN,make) wR2.2(SSN,name,BD) uDecompose R1 using childSSN -> childName childBD: wR1.1(childSSN,childName,childBD) wR1.2(SSN,childSSN) uDecompose R2.1 using VIN -> make: wR2.1.1(VIN,make) wR2.2.2(SSN,VIN) final set of relations