What is the difference between 1nf 2nf and 3nf




















We need to break down the table into two, and the final conversion looks like this -. The overview of the three normal forms tells us one thing for sure - that each normal form is stricter than its predecessor.

For instance, in 2NF, non-prime attributes are not dependent on prime or key attributes, but a non-prime attribute can depend on another non-prime attribute. Moreover, 2NF tackles partial dependency, whereas 3NF focuses on avoiding transitive dependency. With 2NF, we saw that the repeating groups were eliminated from the table, whereas 3NF reduced the redundancy altogether.

Thus, 3NF is a stronger normalization form. A direct comparison between 2NF and 3NF is somewhat misleading as it is not an apples-to-apples comparison.

The choice of normalization depends on your data and end goal. If you aim to reduce the main redundant data, choose 2NF. However, if you are looking to ensure referential integrity, 3NF is a better choice. Table of contents. These smaller tables will be related to each other through well defined relationships.

In a well normalized database, any alteration or modification in data will requires modifying only a single table. Codd, who is also the inventor of the relational model and the concept of normalization.

A table that complies with 1NF assures that it actually represents a relation i. One important property is that a table that comply with 1NF could not contain any attributes that are relational valued i. For a table to comply with 2NF, it should be complied with 1NF and any attribute that is not a part of any candidate key i. So a relation will be in first normal form if it contains atomic values. The relation should contain only single valued attributes. Thus a relation that is in the first normal form must follow the following rules: There should be no repeating groups or elements in the relation, i.

There should be a unique name to be specified for each attribute within the table. It should not contain any composite attributes. Example: Consider the following relation: Attention reader! Skip to content. Change Language.



0コメント

  • 1000 / 1000