Professional Documents
Culture Documents
School Of Computer
Engineering
q Normalization
q Functional Dependency(FD)
q Trivial FDs and Non-Trivial FDs
q Armstrong’s Inference Axioms
q Logical Implication
q Closure of a Set of Attribute
q Finding all candidate Keys
q Checking whether an attribute set is a super kry or candidate key
q Computing F +
q Membership Test
A B C
a1 b1 c1
a2 b2 c2
a1 b1 c3
a2 b3 c2
a3 b4 c4
Trivial FDs and Non-Trivial FDs
9
Ø Trivial FDs:
ü A functional dependency X→Y is a trivial functional dependency if Y is a
subset of X.
ü For example, {Name, Course}→ Course. If two records have the same
values on both the Name and Course attributes, then they obviously have
the same Course.
ü Trivial dependencies hold for all relation instances.
Ø Non-Trivial FDs:
ü A functional dependency X→Y is called as non-trivial type if Y∩X =Φ.
ü For example, S_Roll → S_Name.
ü Non-trivial FDs are given implicitly in the form of constraints when
designing a database.
Armstrong’s Inference Axioms
10
Ø The inference axioms or rules allow users to infer the FDs that are satisfied by a
relation.
Ø Let R (X, Y, Z, W) where X, Y, Z, and W are arbitrary subsets of the set of
attributes of a universal relation schema R.
Ø The three fundamental inference rules are:
3. Computing F+
4. Membership Test
Keys
16
Ø Super key: An attribute or a set of attribute that has uniqueness property is
called super key. If an attribute set closure contains all attributes of relation
then it called as a super key.
Ø Key: An attribute or a set of attribute that has uniqueness and Minimality
property is called key.
Ø Candidate Key: The set of all the keys.
Ø Primary Key: One of the candidate key that is selected by the database
designer for a particular application.
Ø Alternate Key: All the candidate keys except primary key are called
alternate key.
Ø Foreign Key: An attribute or a set of attribute of one relation that refers to the
primary key of same or other relation is called foreign key.
1. Finding all Candidate Keys
17
1. R (ABC)
F= { A B,
B C}
2. R (ABC)
F = {A B,
B C,
C A}
3. R (ABCD)
F={A C,
B D}
4. R (ABCD) 5. R (ABCD)
F = { AB C, F = { AB C,
C D, B D,
A B} D B}
2. Checking whether an attribute set is Candidate Key
18
1. R (ABCDE) Check for AB ?
F= { AB C,
C D,
D E,
A B}
2. R (ABCDE) Check for AD ?
F = {A B,
B CD ,
D E,
AB D}
3. Closure of a Set of Functional Dependencies
19
Ø Given a set F of functional dependencies for a relation schema R, we define F +,
the closure of F, to be the set of all functional dependencies that are logically
implied by F. Mathematically,
F ={X→Y/F|=X→Y}
Ø To generate all FDs that can be derived from F, the steps are:
ü First, apply the inference axioms to all single attributes and use the FDs of
F whenever it is applicable
ü Second, apply the inference axioms to all combinations of two attributes
and use the functional dependencies of F whenever it is applicable
ü Next apply the inference axioms to all combinations of three attributes and
use the FDs of F when necessary
ü Proceed in this manner for as many different attributes as there are in F
Computing F+
20
1. R (ABC) Find out F+ ?
F= { A B,
B C}
2. R (AB)
F={A B,
B A}
3. R (ABC)
F = { AB C,
C B,
B A}
Closure of a Set of Functional Dependencies
21
Ø Let R=(A, B, C) and F={A→B, A→C}