0% found this document useful (0 votes)
88 views

Full Functional Dependency: Types of Decomposition

A full functional dependency exists when the removal of any attribute from the determining set causes the dependency to no longer hold. A partial functional dependency still holds even if some attributes are removed from the determining set. Decomposition can be either lossy or lossless, where lossy introduces additional tuples and lossless reproduces the original relation through join. Normalization minimizes redundancy and anomalies by decomposing relations based on functional dependencies and keys into first, second, and third normal form.

Uploaded by

subhajit
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
88 views

Full Functional Dependency: Types of Decomposition

A full functional dependency exists when the removal of any attribute from the determining set causes the dependency to no longer hold. A partial functional dependency still holds even if some attributes are removed from the determining set. Decomposition can be either lossy or lossless, where lossy introduces additional tuples and lossless reproduces the original relation through join. Normalization minimizes redundancy and anomalies by decomposing relations based on functional dependencies and keys into first, second, and third normal form.

Uploaded by

subhajit
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 4

FULL FUNCTIONAL DEPENDENCY

A functional dependency X⸺⸺>Y is a full functional dependency if removal of


any attribute A from X means dependency does not hold any more.
Say, A & B are two attributes
A B ⸺⸺>Z
Now if A or B is removed,
e.g. A ⸺/⸺>Z or B ⸺/⸺>Z ; in any case, it is called full functional dependency.

PARTIAL FUNCTIONAL DEPENDENCY


A functional dependency X⸺⸺>Y is a partial functional dependency if some
attribute A is removed from X and the dependency still holds.
e.g. A B ⸺⸺>Z
A ⸺⸺>Z is a partial functional dependency.

DECOMPOSITION
R={A1, A2, …, An} ; A1, A2, …, An are attributes, R is a relation.
D= {R1, R2, …, Rn} is the set comprising of relations.

Types of Decomposition
i) Lossy Decomposition
If we do natural join of {R1, R2, …, Rn} some additional tuples called
spurious tuples (those are not present in the relation) are generated. This
is called lossy decomposition.
ii) Lossless Decomposition
A relation{R1, R2, …, Rn} of relation R is called a lossless decomposition
of R , if the natural join of {R1, R2, …, Rn} produces exactly the relation
R.
Sup_City
S,No. City Status
1A Silchar 10
1B Kolkata 20
1C Mumbai 20
1D Kolkata 20

S,No. City(key)
1A Silchar
1B Kolkata
1C Mumbai
1D Kolkata

City(key) Status
Silchar 10
Kolkata 20
Mumbai 20

S,No. Status(key)
1A 10
1B 20
1C 20
1D 20

City Status(key)
Silchar 10
Kolkata 20
Mumbai 20
Kolkata 20
If natural join is done based on City, then it is lossless i.e.,
S,No. City Status
1A Silchar 10
1B Kolkata 20
1C Mumbai 20
1D Kolkata 20
If natural join is done based on status, then it is lossy
i.e.,
S,No. City Status Comment
1A Silchar 10 Correct
1B Kolkata 20 Correct
1B Mumbai 20 Wrong
1C Kolkata 20 Wrong
1C Mumbai 20 Correct
1D Kolkata 20 Correct
1D Mumbai 20 Wrong

NORMALIZATION
Normalization is the process of analysing a given relation schema based on
functional dependency and keys so that the given schema can be decomposed into
smaller schema in order to minimize redundancy, null values, updating anomalies.
There are three forms:
Unnormalized
1 N.F.
A relation schema R is in 1 N.F. if there is i) no composite attribute, ii) no
multivalued attribute, iii) no combination of composite and multivalued attribute.
Book_Info
ISBN Price Page Count P_ID R_ID Rating
I01 R01 6
R02 7
This is Unnormalized case.
ISBN Price Page Count P_ID R_ID Rating
I01 25 200 P1 R01 6
I02 25 200 P1 R02 7
st
This is 1 Normal form
2 N.F.
A relation schema R is in 2NF if it is in 1NF and every non-prime attribute A is
fully functionally dependent on every key of relation R.
It also follows transitivity rule.
BOOK
ISBN Price Page Count P_ID
I-01 --- ------ ---

Here ISBN is a primary key. ISBN- Price, ISBN Page Count, ISBN P_ID
are written as ISBN {Price, Page Count, P_ID} in a combined way.
Reviews
ISBN R_ID Rating

Here {ISBN, R_ID} is the primary key. (ISBN,R_ID) Rating


Page_Count Price --Transitivity may or may not exists.

You might also like