Database Normalizatio
- is a process used to organize a database into tables and columns.
- By limiting a table to one purpose you reduce the number of duplicate data contained within your database.
Reasons for Database Normalization
- To minimize duplicate data.
- to minimize or avoid data modification issues.
- to simplify queries.
Data Duplication and Modification Anomalies
-
Duplicated information presents two problems:
- It increases storage and decrease performance.
-
It becomes more difficult to maintain data changes.
-
Database normalization fixes the situations are modification anomalies.
- There are three modification anomalies that can occur:
Insert Anomaly
- There are facts we cannot record until we know information for the entire row. so in order to create the record, we need provide a primary key.
Update Anomaly
- In this case we have the same information in several rows. If we don’t update all rows, then inconsistencies appear.
Deletion Anomaly
- Deletion of a row causes removal of more than one set of facts.
Search and Sort Issues
-
You can eliminate or reduce the issues of sorting and searching anomalies by separating the data into different tables. This puts the data into tables serving a single purpose.
-
The process to redesign the table is database normalization.
Definition of Database Normalization
-
There are three common forms of database normalization: 1st, 2nd, and 3rd normal form. They are also abbreviated as 1NF, 2NF, and 3NF respectively.
-
The forms are progressive, meaning that to qualify for 3rd normal form a table must first satisfy the rules for 2nd normal form, and 2nd normal form must adhere to those for 1st normal form.
- First Normal Form – The information is stored in a relational table with each column containing atomic values. There are no repeating groups of columns.
- Second Normal Form – The table is in first normal form and all the columns depend on the table’s primary key.
- Third Normal Form – the table is in second normal form and all of its columns are not transitively dependent on the primary key