What is database normalization?-Database normalization
It is a process of analyzing the given relation schemas based on their functional
dependencies and primary keys to achieve the following desirable properties:
1)Minimizing Redundancy
2) Minimizing the Insertion, Deletion, And Update Anomalies
Relation schemas that do not meet the properties are decomposed into smaller relation
schemas that could meet desirable properties.
Normalization is used to reduce data redundancy is called
Database normalization
.
A database anomaly is a flaw in the database that occurs because of bad planning and redundancy.
- Insertion anomalies:
- Updation anomalies:
- Deletion anomalies:
Database normalization
are four types of normal forms that are usually used in relational databases as you can see in the following figure:
- 1NF: A relation is in 1NF(First Normal Form) if all its attributes have an atomic value.
- 2NF: A relation is in 2NF(Second Normal Form) if it is in 1NF and all non-key attributes are fully functional dependent on the candidate key.
- 3NF: A relation is in 3NF(Third Normal Form) if it is in 2NF and there is no transitive dependency.
- BCNF: A relation is in BCNF(Boyce-Codd Normal Form) if it is in 3NF and for every Functional Dependency, LHS is the super key.