Introduction
In DBMS (Database Management System), Normalization is a process used to organize and structure the data in the database properly.
It helps in:
📉 Reducing duplicate data (redundancy),
✅ Maintaining accuracy and consistency (data integrity),
🚀 And improving database performance.
In simple words, Normalization means designing database tables in such a way that:
No data is stored again and again,
Related data stays grouped together properly.
🎯 Purpose of Normalization
The main goals of normalization are:
Remove repeated data,
Keep the data consistent and accurate,
Make the database clean and efficient.
🔄 Steps of Normalization
Normalization generally follows two main steps:
1️⃣ Removing Redundant Data
– Any repeated data in the tables is removed.
2️⃣ Organizing Related Data
– Every table stores only the data that is related to that table’s purpose.
📘 Types of Normal Forms in DBMS
There are five main types of Normal Forms used in DBMS. These were first proposed by E.F. Codd (the father of relational databases).
Let’s understand them one by one with simple examples:
📗 1NF – First Normal Form
Goal: Make sure all data is stored in atomic (indivisible) values.
✅ Rules:
No column should have multiple values.
Each column should contain only one value.
📌 Bad Example (Not in 1NF):
Roll_No | Name | Subjects |
---|---|---|
1 | Raj | Math, Science |
2 | Priya | English |
Here, “Subjects” column has more than one value.
📌 Fixed Table (In 1NF):
Roll_No | Name | Subject |
---|---|---|
1 | Raj | Math |
1 | Raj | Science |
2 | Priya | English |
📘 2NF – Second Normal Form
Goal: Remove partial dependency.
✅ Rules:
It must be in 1NF.
Every non-key column should depend fully on the primary key.
📌 Example:
Roll_No | Subject | Teacher |
---|---|---|
1 | Math | Mr. A |
1 | Science | Mr. B |
In this table, each non-key column depends on the full key. So, it’s in 2NF.
📙 3NF – Third Normal Form
Goal: Remove transitive dependency.
✅ Rules:
It must be in 2NF.
No non-key column should depend on another non-key column.
📌 Example (Not in 3NF):
Roll_No | Subject | Teacher | Department |
---|---|---|---|
1 | Math | Mr. A | Science |
Here, “Department” depends on “Teacher”, which depends on “Subject”. This is a transitive dependency.
📌 To fix this, make separate tables:
One for Subject–Teacher
One for Subject–Department
Now, it’s in 3NF.
📕 4NF – Fourth Normal Form
Goal: Remove multi-valued dependency.
✅ Rules:
Table must be in 3NF.
No column should have unrelated multiple values.
📌 Bad Example:
Student | Course | Hobby |
---|---|---|
Raj | Math | Cricket |
Raj | Science | Football |
Here, Courses and Hobbies are stored together, even though they are unrelated.
📌 Fixed Version:
➡️ Course Table:
Student | Course |
---|---|
Raj | Math |
Raj | Science |
➡️ Hobby Table:
Student | Hobby |
---|---|
Raj | Cricket |
Raj | Football |
Now it’s in 4NF.
📒 5NF – Fifth Normal Form (PJNF)
Also called: Project-Join Normal Form
Goal: Handle complex relationships between tables.
✅ Rules:
Must be in 4NF.
Table should not be broken further unless it’s needed for a lossless join (i.e., we can get the original data back by joining the tables).
📌 Example:
Employee | Project | Skill |
---|---|---|
Raj | Project A | Java |
Raj | Project A | Python |
Raj | Project B | Java |
Raj | Project B | Python |
This table has lots of repetition.
📌 To normalize (5NF), break it into 3 tables:
➡️ Employee–Project Table:
Employee | Project |
---|---|
Raj | Project A |
Raj | Project B |
➡️ Employee–Skill Table:
Employee | Skill |
---|---|
Raj | Java |
Raj | Python |
➡️ Project–Skill Table:
Project | Skill |
---|---|
Project A | Java |
Project A | Python |
Project B | Java |
Project B | Python |
These three tables, when joined, give us the same original table, but now without redundancy.
🔄 Bonus: What is BCNF?
BCNF (Boyce-Codd Normal Form) is an advanced version of 3NF where:
Every functional dependency has a candidate key on the left-hand side.
It fixes some special cases where 3NF is not strong enough.
📚 Final word
🎓 Normalization is very important in database design. It helps:
Avoid duplicate data,
Keep everything accurate,
Make updates easier.
DBMS में Normalization क्या है?
परिचय (Introduction)
DBMS (डेटाबेस मैनेजमेंट सिस्टम) में Normalization एक प्रक्रिया होती है जिसका उपयोग डेटाबेस में डाटा को सही तरीके से व्यवस्थित और संरचित (Organize & Structure) करने के लिए किया जाता है।
इसका मुख्य फायदा यह है कि:
📉 Duplicate data (एक ही डाटा का बार-बार आना) कम होता है,
✅ Data की सटीकता और एकरूपता (accuracy and consistency) बनी रहती है,
🚀 और डाटाबेस की स्पीड और परफॉर्मेंस बेहतर होती है।
साधारण शब्दों में कहें तो, Normalization का मतलब है कि हम डेटाबेस के table को इस तरह से डिजाइन करें कि:
एक ही डेटा बार-बार न लिखा जाए,
और जो डेटा आपस में जुड़ा हुआ है, वो एक साथ ही रखा जाए।
🎯 Normalization का उद्देश्य
Normalization करने के मुख्य उद्देश्य होते हैं:
बार-बार दोहराया जाने वाला डाटा हटाना,
डाटा को सटीक और consistent बनाना,
और डेटाबेस को साफ-सुथरा और स्मार्ट बनाना।
🔄 Normalization के दो स्टेप
Normalization आमतौर पर दो मुख्य स्टेप में होती है:
1️⃣ Duplicate Data को हटाना
– यानी जो डाटा बार-बार टेबल में रिपीट हो रहा हो, उसे हटाना।
2️⃣ Related Data को अलग करना
– हर टेबल में केवल उसी से जुड़ा हुआ डाटा ही रखा जाए।
📘 DBMS में Normal Forms के प्रकार
DBMS में Normalization के कुल 5 मुख्य प्रकार (Normal Forms) होते हैं। इन्हें सबसे पहले E.F. Codd ने पेश किया था।
आइए इन्हें आसान उदाहरणों के साथ समझते हैं:
📗 1NF – First Normal Form
उद्देश्य: हर डेटा को छोटे-छोटे हिस्सों (atomic values) में रखना।
✅ नियम:
किसी भी कॉलम में एक से ज़्यादा वैल्यू नहीं होनी चाहिए।
हर कॉलम में सिर्फ एक ही वैल्यू हो।
📌 गलत उदाहरण (1NF में नहीं):
Roll_No | Name | Subjects |
---|---|---|
1 | Raj | Math, Science |
2 | Priya | English |
यहाँ “Subjects” कॉलम में एक से ज्यादा वैल्यू हैं।
📌 सही उदाहरण (1NF में):
Roll_No | Name | Subject |
---|---|---|
1 | Raj | Math |
1 | Raj | Science |
2 | Priya | English |
📘 2NF – Second Normal Form
उद्देश्य: Partial Dependency को हटाना।
✅ नियम:
पहले टेबल 1NF में होना चाहिए।
हर Non-key कॉलम, पूरे Primary Key पर ही निर्भर हो।
📌 उदाहरण:
Roll_No | Subject | Teacher |
---|---|---|
1 | Math | Mr. A |
1 | Science | Mr. B |
यह टेबल 2NF में है क्योंकि इसमें कोई partial dependency नहीं है।
📙 3NF – Third Normal Form
उद्देश्य: Transitive Dependency को हटाना।
✅ नियम:
पहले टेबल 2NF में होना चाहिए।
कोई Non-key कॉलम, दूसरे Non-key कॉलम पर निर्भर न हो।
📌 गलत उदाहरण (3NF में नहीं):
Roll_No | Subject | Teacher | Department |
---|---|---|---|
1 | Math | Mr. A | Science |
यहाँ “Department” → “Teacher” → “Subject” पर निर्भर है (transitive dependency)।
📌 सही तरीका:
Subject-Teacher और Subject-Department को अलग-अलग टेबल में रखें। तब यह 3NF में आ जाएगा।
📕 4NF – Fourth Normal Form
उद्देश्य: Multi-valued Dependency को हटाना।
✅ नियम:
पहले टेबल 3NF में होना चाहिए।
एक ही टेबल में असंबंधित (unrelated) multiple values न हों।
📌 गलत उदाहरण:
Student | Course | Hobby |
---|---|---|
Raj | Math | Cricket |
Raj | Science | Football |
यहाँ Course और Hobby एक साथ दिखाए गए हैं, जबकि दोनों का आपस में कोई संबंध नहीं है।
📌 सही तरीका:
➡️ Course Table:
Student | Course |
---|---|
Raj | Math |
Raj | Science |
➡️ Hobby Table:
Student | Hobby |
---|---|
Raj | Cricket |
Raj | Football |
अब टेबल 4NF में है।
📒 5NF – Fifth Normal Form (PJNF)
दूसरा नाम: Project-Join Normal Form
उद्देश्य: टेबल्स के बीच के जटिल (complex) रिलेशनशिप को ठीक करना।
✅ नियम:
पहले टेबल 4NF में होनी चाहिए।
टेबल को तब तक और छोटे टेबल्स में नहीं तोड़ना चाहिए जब तक कि उन्हें फिर से जोड़कर (join) original टेबल ना बनाया जा सके।
📌 उदाहरण:
Employee | Project | Skill |
---|---|---|
Raj | Project A | Java |
Raj | Project A | Python |
Raj | Project B | Java |
Raj | Project B | Python |
यहाँ बहुत डेटा repeat हो रहा है।
📌 सही तरीका: 3 अलग टेबल बनाएँ:
➡️ Employee–Project Table:
Employee | Project |
---|---|
Raj | Project A |
Raj | Project B |
➡️ Employee–Skill Table:
Employee | Skill |
---|---|
Raj | Java |
Raj | Python |
➡️ Project–Skill Table:
Project | Skill |
---|---|
Project A | Java |
Project A | Python |
Project B | Java |
Project B | Python |
अब कोई डाटा repeat नहीं हो रहा और original टेबल भी recreate हो सकता है।
🔄 बोनस: BCNF क्या है?
BCNF (Boyce-Codd Normal Form) – 3NF का एक और मजबूत रूप है।
✅ इसमें हर Functional Dependency का left-hand side पर Candidate Key होना जरूरी है।
यह कुछ ऐसे मामलों को भी संभालता है जो 3NF में कवर नहीं हो पाते।
📚 अंतिम शब्द
🎓 Normalization DBMS का एक बहुत जरूरी हिस्सा है।
यह हमें:
डुप्लीकेट डाटा से बचाता है,
डेटाबेस को आसान बनाता है,
और भविष्य में अपडेट करना आसान बनाता है।