Today I learned about Normalization in databases.
π What is Normalization?
Normalization is the process of organizing data in a database to eliminate redundancy and improve data integrity. It helps ensure that data is consistent, accurate, and easy to maintain.
β Why do we need Normalization?
- Reduces data duplication
- Ensures consistency across tables
- Saves storage space
- Makes queries more efficient
π§ Example:
Without normalization:
OrderID | CustomerName | CustomerPhone | Product
1 | Ramya | 9876543210 | Laptop
2 | Ramya | 9876543210 | Keyboard
Here, customer details repeat for every order.
With normalization (using separate tables):
Customers Table
CustomerID | Name | Phone
1 | Ramya | 9876543210
Orders Table
OrderID | CustomerID | Product
1 | 1 | Laptop
2 | 1 | Keyboard
π Normal Forms (Levels of Normalization)
- 1NF β Remove repeating groups, keep atomic values.
- 2NF β Remove partial dependency (depends on part of a composite key).
- 3NF β Remove transitive dependency (non-key depends on non-key).
π Key takeaway:
Normalization makes databases clean, consistent, and scalable β a must-have skill for any Data Analyst.
Top comments (0)