Professional Documents
Culture Documents
HE170786 - Nguyen Quy Duong
HE170786 - Nguyen Quy Duong
1
Non-trivial dependency: A -> B is said to be non-trivial
dependency if B is not subset of A.
a)
AB -> C Here C is not subset of AB, so it is non-trivial
dependency
C -> D Here D is not subset of C, so it is non-trivial
dependency
D -> A Here A is not subset of D, so it is non-trivial
dependency
b)
None of the dependency having B in their right hand side
of dependency, so key must include B.
Finding closures:
(AB)+ = ABCD
(BC)+ = ABCD
(BD)+ = ABCD
c)
Super key: Adding zero or more attributes to candidate
key produces super key.
Here keys are AB, BC and BD.
Super key but not key: Adding at least one attribute will
generate a super key which is not a key.
Here ABC, ABD, BCD and ABCD are the super keys
which are not keys.
3.2.2
i.) S(A,B,C,D) with Functional Dependencies (FD's) A-->B,B-->C and B-->D.
Also, in all FD's the right-hand side contains a single attribute, hence that condition is
also satisfied,
b.) Keys of S: Now to find the keys, we need to first find any attribute that does not
appear on the right side of any FD('A' is not derivable by any other attributes), which
in this case is 'A', Hence the keys of S will definitely contain 'A'.
Next, we find the closure of A, that is all the attributes derivable by 'A'.
A+=ABCD
As seen, all the attributes of S are derivable from A, Hence 'A' is a candidate key.
Since 'A' is not derivable from any other attribute, Hence no other keys are present.
c.) All the Superkeys that are not keys: These are the superset of the candidate keys,
which are able to identify the tuples of the relation uniquely,
Here since 'A' is a candidate key, all the combinations of 'A' with other attributes are
super keys,
Like AB+=ABCD, AC+=ABCD, AD+=ABCD,
ABD+=ABCD,ABC+=ABCD,ACD+=ABCD,ABCD+=ABCD.
But they don't qualify for candidate keys, since a subset of these superkeys that is
'A', ,.............
a.) Non-trivial Functional Dependencies: Here also, all the FD's are Non-trivial,
Since no right side attribute is a subset of the attributes on the left-hand side.
Also, in all FD's the right-hand side contains a single attribute, hence that condition is
also satisfied,
b.) Keys of T: Now to find the keys, we need to first find any attribute that does not
appear on the right side of any Here all attributes are present on the right-hand side of
any FD.
Here no single attribute is able to derive all the attributes, so now we check pairs by
finding their closures.
AC+=AC, does not derive all the attributes of T so it is not a Candidate key.
BD+=BD, does not derive all the attributes of T so it is not a Candidate key.
So Candidate Keys={AB,BC,CD,DA}
c.) All the Superkeys that are not keys: These are the superset of the candidate keys,
which are able to identify the tuples of the relation uniquely,
Now here since Candidate Keys={AB, BC, CD, DA}, So any combination of these
keys with other attributes is a super key,
But they don't qualify for candidate keys, since a subset of these superkeys is
Candidate key,
iii.) U(A,B,C,D) with Functional Dependencies (FD's) A-->B, B-->C, C-->D, and
D-->A
a.) Non-trivial Functional Dependencies: Here also, all the FD's are Non-trivial,
Since no right side attribute is a subset of the attributes on the left-hand side.
Also, in all FD's the right-hand side contains a single attribute, hence that condition is
also satisfied,
b.) Keys of T: Now to find the keys, we need to first find any attribute that does not
appear on the right side of any Here all attributes are present on the right-hand side of
any FD.
So Candidate Keys={A,B,C,D}
c.) All the Superkeys that are not keys: These are the superset of the candidate keys,
which are able to identify the tuples of the relation uniquely,
Now here since Candidate Keys={A,B,C,D}, So any combination of these keys with
other attributes is a super key,
But they don't qualify for candidate keys, since a subset of these superkeys is a
Candidate key.
Exercise 3.2,9:
(A - > B, B -> A, B -> C, C -> B)(A -> B, B -> C, C -> A)