You are on page 1of 2

Example 3.

A relation with attributes A,B,C,D,E and F.Suppose that this


relation has the FD’s AB->C,BC->AD,D->E and CF->B.What
is the closure of (A,b), that is {A,B}+
{A,B,C,D,E}

Exercise 3.2.1
Consider a relation with schema R(A,B,C,D) and FD’s
AB→C, C→D and D→A
a) What are all the nontrieval FD’s that follow from the
given FD’s? you should restrict yourself to FD’s with single
attributes on the right side.
b) What are all the keys of R?
c) What are all the superkeys for R that are not keys?
Solutions:
a) Nontrivial FD’s (Implied FD’s)
Given FD’s: AB→C, C→D, D→A
A+=A, B+=B,C+={C,D,A},D+={D,A}
AB+={A,B,C,D},AC+={A,C,,D},AD+={A,D},
BC+={B,C,D,A},BD+={B,D,A,C},CD+={C,D,A}
ABC+= ABD+=BCD+={B,C,D,A} ACD+={ACD}
Answer is:
C->A, AB->D, AC->D, BC->A, BC->D, BD->A, BD->C, CD->A,
ABC->D, ABD->C, and BCD->A.
b) AB, BC, and BD are keys
c) ABC, ABD, BCD, and ABCD

Exercise 3.2.4
Show that each of the following are not valid rules about
FD’s by giving example relations that satisfy the given FD’s
(following the “if”) but not the FD that allegedly follows
(after the “then”).
a)If A->B then B->A.
b)If AB->C and A->C, then B->C.
c)If AB->C, then A->C or B->C.

You might also like