DEV Community

Ramya .C
Ramya .C

Posted on

๐Ÿ“Š Day 36 of My Data Analytics Journey โ€“ Normalization !

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

Uploading image

๐Ÿ”ง Example:

Without normalization:

OrderID | CustomerName | CustomerPhone | Product  
1       | Ramya        | 9876543210    | Laptop  
2       | Ramya        | 9876543210    | Keyboard  
Enter fullscreen mode Exit fullscreen mode

Here, customer details repeat for every order.

With normalization (using separate tables):

Customers Table

CustomerID | Name   | Phone  
1          | Ramya  | 9876543210  
Enter fullscreen mode Exit fullscreen mode

Orders Table

OrderID | CustomerID | Product  
1       | 1          | Laptop  
2       | 1          | Keyboard  
Enter fullscreen mode Exit fullscreen mode

๐Ÿ“š Normal Forms (Levels of Normalization)

  1. 1NF โ€“ Remove repeating groups, keep atomic values.
  2. 2NF โ€“ Remove partial dependency (depends on part of a composite key).
  3. 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)