typically “normalized” refers incorrectly to 3NF • Normalization helps control redundancy • Normalization is reversible; i.e. nonloss, or information preserving • Six normal forms are discussed: 1 through 5, and Boyce-Codd Normal Form (BCNF), which is an improvement on 3NF
decompose relvars • Recomposition is a process of joins • The decomposition of relvar R into projections R1…Rn is nonloss if R = the join of R1…Rn • The normalization procedure can be seen as a method for eliminating functional dependencies that do not emanate from a candidate key
attributes are both mutually independent and irreducibly dependent on the primary key • A relvar is in 3NF if and only if, for all time, each tuple consists of a primary key value that identifies some entity, together with a set of zero or more mutually independent attribute values that describe that entity in some way
• A relvar is in 1NF if and only if in every legal
value of that relvar, every tuple contains exactly one value for each attribute • In this way, relvars are always in 1NF • A relvar in 1NF may display functional dependencies other than those emanating from the primary key • Such non-primary-key dependencies promote a miasma of update anomolies
• An INSERT anomaly occurs when the user wishes to record a subordinate fact that is not dependent on the primary key (e.g., recording a supplier location before the supplier supplies a part) • A DELETE anomaly, conversely, may delete the location inadvertently • An UPDATE anomaly occurs when many updates are required to record a simple fact
and every nonkey attribute is irreducibly dependent on the primary key • (Assumes only one candidate key) • A relvar in 2NF is less susceptible to update anomalies, but may still exhibit transitive dependencies • Both attributes in a transitive dependency are irreducibly implied by the primary key, and each implies the other
and every nonkey attribute is nontransitively dependent on the primary key • (Assumes only one candidate key) • The process of normalization is a series of projections that eliminate complex functional dependencies • Such projections must be able to be recombined via JOIN to form the original relvar
case of nonloss decomposition, such that the normalized relvars are independent of each other • Some nonloss decompositions do not exhibit dependency preservation • Example: decompose supplier, city, status where supplier implies city and status, and city and status imply each other
SC {S#, CITY} CS {CITY, STATUS} • Dependency is not preserved in this one: SC {S#, CITY} CS {S#, STATUS} • Although the second is nonloss, you still cannot update them independently
relvars with more than one candidate key, where the candidate keys are composite and overlapping • A relvar is in BCNF if and only if every nontrivial, left- irreducible FD has a candidate key as its determinant • That is, a relvar is in BCNF if and only if every determinant is a candidate key
values are relations • Traditionally this would be seen to violate 1NF, which was held to prohibit repeating groups • Now they are theoretically sound, but in practice you should avoid them because they have complicated predicates