Mon, Sep 20, 1999 ------------------------ - Review of BCNF - Updating Definition of BCNF given in previous class: A relation R is in BCNF iff for every nontrivial FD X->Y, X is a superkey. - Notice the word "nontrivial" - how BCNF works - why BCNF works - how do you know when to stop "splitting" - Stopping Conditions - reach a two-column relation (why?) - no FD violations in the splitted relations (how do you check this) - project the original FDs down to the reduced space - pick out only those attributes that matter - The 3 Desired Properties of Breakups - what do they mean - Properties guaranteed by BCNF - first two - Properties guaranteed by 3NF - last two - What is 3NF? - weaker than BCNF A relation R is in 3NF iff for every nontrivial FD X->Y, X is a superkey or Y is part of a key. - Notice the phrase "Y is part of a key" - this excuses some cases that BCNF will not allow - 3NF is less restrictive than BCNF - Every BCNF relation is also in 3NF - 3 example problems solved in class - MDs: Generalization of FDs - written as X->->Y - 4NF: Addresses a further source of redundancy not addressed by BCNF - MDs do not obey the same laws as FDs - In FD-world X->Y and X->Z implies X->YZ - In MD-world X->->Y and X->->Z does not imply X->->YZ - What rules do MDs obey? - X->->Y and Y->->Z implies X->->Z - X->->Y implies X->->Z where Z is all attributes of R that are not among the Y's (why is this true) - X->Y implies X->->Y (i.e., every FD is also an MD) - Definition of 4NF - A relation R is in 4NF iff for every nontrivial MD X->->Y, X is a superkey - What does it mean for an MD to be nontrivial? - non-intuitive - An MD X->->Y is nontrivial iff - at least one of the Y's is not among the X's (same as in FD world) - X U Y is *not* the set of all attributes - Why is this catch necessary? - otherwise we can have a two-column relation that is not in 4NF - Bottom line: - It is "intuitive" what it means for an FD to be "trivial" - It is not so intuitive what it means for an MD to be "trivial" - hence the extra clause in the above definition - 4NF implies BCNF implies 3NF - Venn Diagram Notation Wed, Sep 22, 1999 ------------------------ - Review of BCNF, 3NF and 4NF definitions - A small 4NF Problem - What guarantees do each of the NFs provide? 3NF BCNF 4NF -------------------------------------------------------------------------- Elimination of redundancies due to FDs Most Yes Yes Elimination of redundancies due to MDs No No No Dependency Preservation: FDs Yes Maybe Maybe Dependency Preservation: MDs Maybe Maybe Maybe - Which normal form to choose? - depends on your application - is elimination of redundancy important or is dependency preservation important? - What exactly is dependency preservation, anyway? - examples - what's its use: saves time and cost during inserts, updates, etc. - End of Module 1! (Phew!) - Module 2 begins - Introduction to DDL in SQL - Introduction to 3 Query Languages - Return graded homework #2