**Normalization**
Normalization can be defined as:-
A process of organizing the data in database to avoid data redundancy, insertion anomaly, update
anomaly and deletion anomaly.
A process of organizing data into tables in such a way that the results of using the database are
always unambiguous and as intended. Such normalization is intrinsic to relational database theory.
---
**Types of Normalization**
1. First Normal Form (1NF)
2. Second Normal Form (2NF)
3. Third Normal Form (3NF)
4. Boyce-Codd Normal Form (BCNF)
5. Fourth Normal Form (4NF)
6. Fifth Normal Form (5NF)
---
### First Normal Form (1NF)
Criteria:
- Eliminate repeating groups in individual tables.
- Create a separate table for each set of related data.
- Identify each set of related data with a primary key.
**Non-1NF Table Example:**
Product table with multi-valued attributes (Colour)
**After 1NF**
Data split to remove multi-valued attributes.
---
### Second Normal Form (2NF)
A table is in 2NF if:
- It is in 1NF
- No non-prime attribute is dependent on a proper subset of any candidate key
**Decomposition Example: Purchase and Store tables**
---
### Third Normal Form (3NF)
A table is in 3NF if:
- It is in 2NF
- No transitive functional dependency exists
**Example: Book table decomposed into Book & Genre tables**
---
### Boyce-Codd Normal Form (BCNF)
Stricter version of 3NF.
Every determinant must be a superkey.
**Example: Student–Course–Teacher table decomposed**
---
### Fourth Normal Form (4NF)
No non-trivial multivalued dependencies other than a candidate key.
**Example: Student–Major–Hobby table decomposed**
---
### Fifth Normal Form (5NF)
Also called Project-Join Normal Form.
Table decomposition should not generate spurious tuples.
**Example: Seller–Company–Product table decomposed**
---