NORMALIZATION
NORMALIZATION
NORMALIZATION
Update
GUIDELINE
Spurious Tuples
GUIDELINE 4: The relations should be designed to
satisfy the lossless join condition. No spurious tuples
should be generated by doing a natural-join of any
relations.
There are two important properties of decompositions:
(a)non-additive or losslessness of the corresponding join
(b)preservation of the functional dependencies.
Functional dependency
its a constraint between two set of attributes
from the db.
A F.D denoted by X-> Y between two sets of
attributes x and y that are subsets of R specifies a
constraint on the possible tuples that can form a
relation state r of R
The constraint is that, for any two tuples t1 & t2 in r
t1[x]=t2[x]
t1[y]=t2[y]
R(X,Y)
X
t1
10
t2
10
Y
d1
d1
There is a FD from X to Y or Y is FD on X
FD=> Functional dependency or f.d
X=> L.H.S
Y=> R.H.S
Eno->Dname
Candidate key
If a relation schema has more than one key, each is called
a candidate key. One of the candidate keys is arbitrarily
designated to be the primary key, and the others are called
secondary keys.
Prime and Non prime attribute
A Prime attribute must be a member of some candidate
key
A Nonprime attribute is not a prime attributethat is, it is
not a member of any candidate key.
1NF-
Composite attribute
Eno
Address
Ename
Fname
Lname
Eno
Address
Fname Lname
Multivalued Attribute
Dno
Dno
Multivalued
Attribute
Dname Dlocation
Dname
Dno Dlocation
Pno
Pname
Eno Pno
Pname
Eg.
R={eno, pno, hours, ename, pname, plocation}
Given functional dependency
FD = {{eno,pno}-> hours,
eno->ename
pno->pname, plocation}
R1={eno,pno,hours}
R2 = {eno,ename}
R3={pno,pname,plocation}
now all the relations R1, R2 and R3 are in full functional
dependency.
Eg:
R={eno, ename, address,dno,dname}
Given functional dependency
F = {eno -> ename,address,dno
dno -> dname}
R1={eno,ename,address,dno} R2 = {dno,dname}
Redundancy of FDs
Canonical Cover
Example of Computing a
Canonical Cover
Finding Keys
A = ABC ,
B+ = B [Reflexivity]
B C D E)
F ={ A->D,
BC-> AD,
C->B,
E->A,
E->D}
Steps:
Singleton attributes in RHS
Identify extraneous attributes and remove it
Remove redundant dependencies
R(A B C D E)
F ={ A->D,
BC-> AD,
C->B,
E->A,
E->D}
Singleton attributes in
RHS
F={ A->D,
BC->A,
BC->D,
C->B,
E->A,
E->D}
BC->A,
BC->D,
C->B,
E->A,
E->D}
F={ A->D,
C->A,
C->D,
C->B,
E->A,
E->D}
C->A,
C->D,
C->B,
E->A,
E->D}
F={ A->D,
C->A,
C->B,
E->A,
}