Download as pdf or txt
Download as pdf or txt
You are on page 1of 5

3.2.

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.

a.) Non-trivial Functional Dependencies: A Non-trivial FD is of form X-->Y where


Y is not a subset of X, , Since here no right side attribute is a subset of the
attributes on the left-hand side,

Hence all the FD's are Non-Trivial FD's.

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', ,.............

is able to uniquely identify all the tuples of S.

A candidate is a minimal super key, that is no set of attributes left in the


Candidate key that can be further dropped, without losing the unique
identification property of the super key.

ii.) T(A,B,C,D) with Functional Dependencies (FD's) AB-->C, BC-->D, CD-->A


AND AD-->B

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.

AB+=ABCD, derives all the attributes of T so it is a Candidate key.

BC+=BCDA, derives all the attributes of T so it is a Candidate key.

CD+=CDAB, derives all the attributes of T so it is a Candidate key.

DA+=DABC, derives all the attributes of T so it is a Candidate key.

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,

ABC+=ABCD, BCD+=ABCD, CDA, ABD, ABCD are all super keys.

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.

Now we check for single attributes:

A+=ABCD, derives all the attributes of U so it is a Candidate key.

B+=BCDA, derives all the attributes of U so it is a Candidate key.

C+=CDAB, derives all the attributes of U so it is a Candidate key.

D+=ABCD, derives all the attributes of U so it is a Candidate key.

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,

Super Keys ={AB,AC,AD,BC,CD,BD,ABC,ABD,ACD,BCD,ABCD,...}

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)

You might also like