Database Normalization
2021-09-15
Ref: https://www.guru99.com/database-normalization.html
Why?
Database normalization is 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.
1NF
Flatten the table and remove duplicate records.
- Each table cell should contain a single value.
- Each record needs to be unique.
2NF
Identify PK for record, must be a single column.
- Usually requires to split table into multiple tables with PKs.
- Single Column Primary Key that does not functionally dependant on any subset of candidate key relation.
3NF
No transitive functional dependencies.
A transitive functional dependency is when changing a non-key column, might cause any of the other non-key columns to change
- more tables with FK relationships