Website/App design एवं college projects आदि के लिए संपर्क करें – 8085589371

Normalization

Normalization एक प्रोसेस है डेटाबेस में डाटा को organize करने की, जिससे redundancy काम हो एवं डाटा इंटीग्रिटी में सुधर हो। Normalization का मुख्य उद्देश्य एक टेबल को एक से अधिक टेबल में विभाजित करना है एवं सबंध (रिलेशनशिप) के आधार पर आपस में link किया जाता है।

इस प्रकिया में normalization के नियमों का पालन किया जाता है (इन्ही नियमों को normalization के नियम कहते है) जिससे डेटाबेस कुशलता से structured रहे। structured डेटाबेस में डाटा query, updatation आदि operation के टाइम काम लगता है।

NOTE – PDF लिंक निचे है – Click Here

Types of Normalization

  • First Normal Form (1NF)
  • Second Normal Form (2NF)
  • Third Normal Form (3NF)
  • Boyce-Codd Normal Form (BCNF)
  • Fourth Normal Form (4NF)

First Normal Form (1NF)

Normalization के प्रथम नियमानुसार टेबल में एटॉमिक (atomic) values होनी चाहिए या टेबल के हर एक कॉलम में केवल और केवल एक वैल्यू होनी चाहिए।

Example (Normalization के बिना)

OrderIDCustomerNameProductNameQuantityUnitPrice
1AlicePen101
1AliceNotebook, Laptop53
2BobPencil200.5

Normalization के बाद

OrderIDCustomerNameProductNameQuantityUnitPrice
1AlicePen101
1AliceNotebook53
1AliceLaptop53
2BobPencil200.5

Second Normal Form (2NF)

Normalization के प्रथम नियमानुसार टेबल (relation) में First Normal Form में होने के साथ-साथ टेबल के सभी non-key attributre पूर्णतयः primary key पर निर्भर हो।

Order Table (Not in 2NF)

OrderIDCustomerNameProductNameQuantityUnitPrice
1AlicePen101
1AliceNotebook53
2BobPencil200.5

Issues with the Table (Not in 2NF)

Redundancy: CustomerName and CustomerAddress repeat हो रहे है product order के लिए।

Partial Dependency: CustomerName and CustomerAddress दोनों केवल OrderID पर depend है, जो की composite primary ((OrderID, ProductID)) का हिस्सा है।

Second Normal Form (2NF) के बाद

Customers Table:

CustomerIDCustomerNameCustomerAddress
1Alice123 Main St
2Bob456 Oak St

Products Table:

ProductIDProductNameUnitPrice
101Pen1.00
102Notebook3.00
103Pencil0.50

Orders Table:

OrderIDCustomerID
11
22

OrderDetails Table:

OrderIDProductIDQuantity
110110
11025
210320

Third Normal Form (3NF)

टेबल तीसरे फॉर्म में होने के लिए पहले 1ंNF एवं 2NF में होनी चाहिए इसके साथ ही सभी attribute प्राइमरी key पर depend होने चाहिए है। इसमें फॉर्म में transitive dependancy (एक non-key attributes किसी दूसरे non-key attributes पर देपेंद न हो) नहीं होनी चाहिए।

Order Table (Not in 3NF):

OrderIDCustomerIDCustomerNameCustomerAddressProductIDProductNameQuantityUnitPriceTotalPrice
11Alice123 Main St101Pen10110
11Alice123 Main St102Notebook5315
22Bob456 Oak St103Pencil200.510

Customers Table:

CustomerIDCustomerNameCustomerAddress
1Alice123 Main St
2Bob456 Oak St

Products Table:

ProductIDProductNameUnitPrice
101Pen1.00
102Notebook3.00
103Pencil0.50

Orders Table:

OrderIDCustomerID
11
22

OrderDetails Table:

OrderIDProductIDQuantityUnitPrice
1101101.00
110253.00
2103200.50

Boyce-Codd Normal Form (BCNF)

इस नार्मल में टेबल 3NF होने के साथ-साथ, हर एक functional dependancy (A -> B), जहाँ A एक सुपर key है। BCNF 3NF का stricter version है।

Example Without BCNF

Student Courses Table (Not in BCNF):

StudentIDCourseIDInstructor
1101Prof. Smith
1102Prof. Jones
2101Prof. Smith
3103Prof. Adams

Issues with the Table (Not in BCNF)

  • Functional Dependency: यहाँ पर instructor depends है CourseID, लेकिन CourseID एक सुपर key नहीं है। StudentID and CourseID एक primary key बनाया जा सकता है।

Students Table:

StudentIDCourseID
1101
1102
2101
3103

Courses Table:

CourseIDInstructor
101Prof. Smith
102Prof. Jones
103Prof. Adams

Fourth Normal Form (4NF)

टेबल को Fourth Normal Form में होने के लिए 3NF एवं BCNF के साथ-साथ multi-valued dependencies न हो।

Student Activities Table (Not in 4NF):

StudentIDActivitySkill
1FootballPainting
1FootballDancing
1BasketballPainting
1BasketballDancing
2FootballSinging
2SwimmingSinging

Issues with the Table (Not in 4NF)

  • Multi-Valued Dependency: एक स्टूडेंट की multiple activities and multiple skills है, जो की redundancy and data anomalies problem को क्रिएट करती है।

Example With 4NF

टेबल को 4NF में करने के लिए, हमें multi-valued dependencies को रिमूव करने पड़ेंगे, जिसके के लिए टेबल को दो अलग-अलग टेबल्स में विभाजित करेंगे किसी भी टेबल में multi-valued dependencies नहीं रहेंगी।

StudentActivities Table:

StudentIDActivity
1Football
1Basketball
2Football
2Swimming

StudentSkills Table:

StudentIDSkill
1Painting
1Dancing
2Singing

इस article में हमने नार्मल फॉर्म्स के बारें पढ़ा, यदि कोई doubt हो तो comment में पूछ सकते है। आर्टिकल पसंद आये हो तो दोस्तों के साथ भी शेयर करें। धन्यवाद !

Leave a Comment

Your email address will not be published. Required fields are marked *

Scroll to Top