728x15 Ads

bar

NORMALIZATION IN DATABASE

Eazy engineering:Normalization tutorial
Normalization:

kisi relation ko uski functional dependencies and keys se analyse karke uski
redudanduncies and updation anomalies ko minimize karne ko normalization kehte hain.

kisi reletion par ya set of relation par hum differnet oprerations perform karke use smaller
relation mein decompose karte hain.jisse hum normalization ki required degree achieve karte
hain.

kisi bhi relation ko decompose karte samay hame do baaton ka dhyan rakhna chahiye.

1.Lossless join decomposition
2. Dependency preservation.


1. Lossless join decomposition:
relation ko decompose karte samay decomposition lossless hoNA chahiye.suppose R ek relation hai
jise hamne R1 and r2 do small relations mein decompose kiya hai. to ye decompositoin lossless agar
at least one propoerty hold karegi
R1 ∩ R2 → R1
R1 ∩ R2 → R2
2. Dependency preservation:
agar ham system mein kuch update karte hain tab system hame ye check karna hota hai ki is update
ki vajah se kahin koi illegal relation to create ni ho rha. ise ham dependencyu preservation kehte hain.


First normal form :

isme ham relations se repeating groups hatate hain and relations ko atomic banate hain.har ek attribute set ke liye different table banate hain. Har ek table emin promary key define karte
hain.

Second normal form:

isme hum redundant data ko remove karte hain. kisi table or relation second normal form mein hone ke
use jarori hai ki vo first normal form mein to ho hi saath mein har non prime attribute ya to poori candidate
key par depend ho ya to kisi other non prime attribute par depend ho.

Third normal form:

isme hum vo columns jo ki key par depend ni kar rhe unhe eliminate karte hain.kisi table ko third normal
mein hone ke liye jaruri hai ki vo second normal form mein ho and har non prime attribute non transitively
dependent hona chahiye super key par.
Non transitively dependent hone ka matlab hai ki directly depend karna super key par.
Iska matlab hai ki agar
X → A,
relation hai to
x ya to a ko conatin kare
ya to x superkey ho.
ya to a-x candidate key mein ho.


BCNF:

ye third normal form ka stronger form hai. agar candidate key ke attributes mein non trivial dependency
hai to hum unhe differnt tables mein seperate kar denge.
koi table bcnf mein hogi agar uski har ek non trivial dependency ex:
X → Y
mein super key hogi . matlab x must be a candidate key .
Copyright © eAZy EnginEEriNG