DB Normalization

Pataasin ang iyong marka sa homework at exams ngayon gamit ang Quizwiz!

Third Normal Form (3NF)

An entity is in the third normal form if it is in the second normal form and all of its attributes are not transitively dependent on the primary key. Transitive dependence means that descriptor key attributes depend not only on the whole primary key, but also on other descriptor key attributes that, in turn, depend on the primary key. In SQL terms, the third normal form means that no column within a table is dependent on a descriptor column that, in turn, depends on the primary key. To convert to third normal form, remove attributes that depend on other descriptor key attributes.

Normalization Summary

The following normal forms are discussed in this section: * First normal form: A table is in the first normal form if it contains no repeating columns. * Second normal form: A table is in the second normal form if it is in the first normal form and contains only columns that are dependent on the whole (primary) key. * Third normal form: A table is in the third normal form if it is in the second normal form and contains only columns that are nontransitively dependent on the primary key.

Normalization Issues

When tables are not in the third normal form, either redundant data exists in the model, or problems exist when you attempt to update the tables. If you cannot find a place for an attribute that observes these rules, you have probably made one of the following errors: The attribute is not well defined. The attribute is derived, not direct. The attribute is really an entity or a relationship. Some entity or relationship is missing from the model.

First Normal Form (1NF)

An entity is in the first normal form if it contains no repeating groups. In relational terms, a table is in the first normal form if it contains no repeating columns. Repeating columns make your data less flexible, waste disk space, and make it more difficult to search for data.

Second Normal Form (2NF)

An entity is in the second normal form if all of its attributes depend on the whole (primary) key. In relational terms, every column in a table must be functionally dependent on the whole primary key of that table. Functional dependency indicates that a link exists between the values in two different columns. If the value of an attribute depends on a column, the value of the attribute must change if the value in the column changes. The attribute is a function of the column. The following explanations make this more specific: If the table has a one-column primary key, the attribute must depend on that key. If the table has a composite primary key, the attribute must depend on the values in all its columns taken as a whole, not on one or some of them. If the attribute also depends on other columns, they must be columns of a candidate key; that is, columns that are unique in every row. If you do not convert your model to the second normal form, you risk data redundancy and difficulty in changing data. To convert first-normal-form tables to second-normal-form tables, remove columns that are not dependent on the primary key.


Kaugnay na mga set ng pag-aaral

MKTG473 Ch. 9: Sales Force Compensation

View Set

Targeted Med Surgery Neuro and Musculoskeletal

View Set

Chapter 6: Stability and Cloud Development

View Set

Healthcare Foundations PrepU ch. 14 Clinical Judgement

View Set

Ch. 17 - Revenue Recognition (17.1 - 17.7)

View Set

Chapter 16: Outcome Identification and Planning

View Set