Database normalization definition
the process of structuring a database, usually a relational database, in accordance with a series of so-called normal forms in order to reduce data redundancy and improve data integrity.
Undesirable side-effects of the database not normalized sufficiently
- Update anomaly: There might be some inconsistent data after the update
- Insertion anomaly: There might be some columns having null data after the insertion because of insufficient information
- Deletion anomaly: There might be lost data chaining with deleted data
Normal forms
Satisfying 1NF
If and only if no attribute domain has relations as elements
(No table column can have tables as values (or no repeating groups))
Satisfying 2NF
1. It is in first normal form
2. It does not have any non-prime attribute that is functionally dependent on any proper subset of any candidate key of the relation
(A non-prime attribute of a relation is an attribute that is not a part of any candidate key of the relation)
Satisfying 3NF
1. It is in second normal form
2. Every non-prime attribute of R is non-transitively dependent on every key of R
Satisfying BCNF (Boyce-Codd Normal Form or 3.5NF)
If and only if for every one of its dependencies X -> Y, at least one of the following conditions hold
1. X -> Y is a trivial functional dependency (Y <= X)
2. X is a super key for schema R
(A super key is a set of attributes that uniquely identifies each tuple of a relation)
댓글