Thursday 26 April 2012

Normal Forms (1NF, 2NF, 3NF, BCNF)

First Normal Form (1NF): A table is said to be in 1NF when each cell of the table contains precisely one value.
Second Normal Form (2NF):  A table is said to be in 2NF when it is in 1NF and every attribute in the row is functionally dependent upon the whole key, and not just part of the key.
Third Normal Form (3NF): A table is said to be in 3NF when it is in 2NF and every non-key attribute is functionally dependent only on the primary key.
Boyce-Codd Normal Form (BCNF): The original definition of 3NF was inadequate in some situations. It was not satisfactory for the tables:
- that had multiple candidate keys
- where multiple candidate keys were composite
- where the multiple candidate keys overlapped.

Therefore, a new normal form, the BCNF was introduced. You must understand that in tables where the above three conditions do not apply, you can stop at the 3NF. In such cases, the 3NF is the same as the BCNF.

A relation is in the BCNF if and only if every determinant is a candidate key.

No comments:

Post a Comment