UNIT III - Functional Dependency
UNIT III - Functional Dependency
Functional dependency
Inference rule
1.Compute the closure of the following set of
functional dependencies for a Relation scheme
R(A,B,C,D,E) F={A->BC,CD->E,B->D,E->A)
Consider F as follows
A->BC
CD->E
B->D
E->A
2.Compute the closure of the following set of functional
dependencies for a Relation scheme R(A,B,C,D,E) F={A-
>BC,CD->E,B->D,E->A) and Find the candidate key.
Solve :
2. R(A,B,C,D,E,F) F={ AB->C, C->A , BC->D, ACD->B,
BE->C,
CE->FA , CF->BD, D->EF}
Canonical cover or
Minimal cover
Definition : An attribute of a functional dependency is
said to be extraneous if we can remove it without
changing the closure of the set of functional
dependencies.
Algorithm : Minimal Cover or Canonical Cover
Solve:
6. ConsiderthefollowingrelationR(A,B,C,D,E,F)and FDs
A->BC,C->A,D->E, F->A, E->D is the decomposition
of R into R1(A,C,D), R2(B,C,D), and R3(E,F,D). Check
Dependency Preservation
7. Let relation R(A,B,C,D) be a relational schema with
following functional dependencies{A->B,B->C,C->D,andD-
>B}. The decomposition of R into(A,B),(B,C) and (B,D).
Check whether this decomposition is dependency preserving
or not.
Raju 24 DS Hindi
TABLE 1 TABLE 2
21 Telugu
Sai 21 CSE
21 English
22 English
Shiva 22 HTML
22 Hindi
Raju 24 DS 24 English
24 Hindi
Name Roll No Branch
Sai 21 CSE
Shiva 22 HTML
Raju 23 DS
Suresh 24 ECE
Branch Fees
HTML 0,000
DS 10,000
ECE 5000
TABLE: STUDENT TABLE 1: STUDENT
Roll No Name Branch_id Branch Roll No Name
22 Shiva
22 Shiva 122 HTML
23 Raju
23 Raju 123 DS
24 Suresh
24 Suresh 121 CSE
TABLE 2: DEP
121 CSE
Super key not a super key 122 HTML
123 DS