Wednesday, December 15, 2010

Normalization

Second normal form (2NF) is based on the concept of full functional dependency. A functional dependency X->Y is a full functional dependency if removal of any attribute from X means that the dependency does not hold anymore.

Test:

For relations where primary key contains multiple attributes, no nonkey attribute should be functionally dependent on a part of the primary key.

Remedy:

Decompose and set up a new relation for each partial key with its dependent attribute(s).  Make sure to keep a relation with the original primary key and any attributes that are fully functionally dependent on it.
----------------------------------------------------------------------------------------------------------
Third normal form (3NF) is based on the concept of transitive dependency.  A functional dependency X->Y in a relation schema R is transitive dependency if there is a set of attributes Z that is neither a candidate key nor a subset if any key of R and both X->Z and Z->Y hold.

Test:

Relation should not have a nonkey attribute functionally determined by another nonkey attribute(or by set of nonkey attributes).  That is, there should be no transitive dependency of a nonkey attribute on the primary key.

Remedy:

Decompose and set up a relation that includes nonkey attribute(s) that functionally determine(s) other nonkey attribute(s).

For another example:

      Using google.com enter the key word Normalization Examples Spring 2006.  Download the file.

Reference:

Elmasri, R. and Navathe, S.B., Fundamentals of Database Systems, 5th Edition, Addison Wesley, 2007. ISBN: 981-06-9800-3.









No comments:

Post a Comment