Unit-3 Functional Dependency & Normalization
Unit-3 Functional Dependency & Normalization
St-100-Course-taken
Course-id Course-description Credit-hours Grade
IS380 Database Concepts 3 A
IS416 Unix Operating System 3 B
St-200-Course-taken
Course-id Course-description Credit-hours Grade
IS380 Database Concepts 3 B
IS416 Unix Operating System 3 B
IS420 Data Net Work 3 C
St-300-Course-taken
Course-id Course-description Credit-hours Grade
IS417 System Analysis 3 A
Student-courses Integrated:
Sid SName Phone Course Course-Description Credit Grade
Id Hours
100 John 487 2454 IS380 Database Concepts 3 A
100 John 487 2454 IS416 Unix OS 4 B
200 Smith 671 8120 IS380 Database Concepts 3 B
200 Smith 671 8120 IS416 Unix OS 4 B
200 Smith 671 8120 IS420 Data Network 2 C
300 Russell 871 2356 IS417 System Analysis 5 A
Functional Dependency 1
Functional Dependency 2
Thus, whenever two tuples have the same value on A, they must also have the same value
on H, and we can say that A H.
4. The closure of a set F of functional dependencies is the set of all functional dependencies
logically implied by F.
5. We denote the closure of F by .
6. To compute , we can use some rules of inference called Armstrong's Axioms:
o Reflexivity rule: if is a set of attributes and , then holds.
o Augmentation rule: if holds, and is a set of attributes, then
holds.
o Transitivity rule: if holds, and holds, then holds.
7. These rules are sound because they do not generate any incorrect functional
dependencies. They are also complete as they generate all of .
8. To make life easier we can use some additional rules, derivable from Armstrong's
Axioms:
o Union rule: if and , then holds.
o Decomposition rule: if holds, then and both hold.
o Pseudo-transitivity rule: if holds, and holds, then holds.
9. Applying these rules to the scheme and set F mentioned above, we can derive the
following:
o A H, as we saw by the transitivity rule.
o CG HI by the union rule.
o AG I by several steps:
Note that A C holds.
Then AG CG, by the augmentation rule.
Now by transitivity, AG I.
(You might notice that this is actually pseudo-transitivity if done in one step.)
Normalization
Normalization is a process in which we systematically examine relations for
anomalies and, when detected, remove those anomalies by splitting up the
relation into two new, related, relations.
If a database design is not perfect, it may contain anomalies, which are like
a bad dream for any database administrator. Managing a database with
anomalies is next to impossible.
Update anomalies − If data items are scattered and are not linked to each
other properly, then it could lead to strange situations. For example, when
we try to update one data item having its copies scattered over several
places, a few instances get updated properly while a few others are left with
old values. Such instances leave the database in an inconsistent state.
Insert anomalies − We tried to insert data in a record that does not exist at
all.