0% found this document useful (0 votes)
28 views4 pages

DBI202

Uploaded by

longvstroll
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
28 views4 pages

DBI202

Uploaded by

longvstroll
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
You are on page 1/ 4

Exercise slot5-1

Solution:
Ex 3.2.1:

a) Nontrivial FDs that follow from the given FDs with single attributes on the right side:

 AB → C (given)
 C → D (given)
 D → A (given)
 ABC → D (by transitivity from AB → C and C → D)
 BD → A (by transitivity from D → A and C → D)
 ABD → C (by augmentation from AB → C)

b) Keys of R: The keys of a relation are the minimal superkeys that uniquely identify each tuple. To find
the keys, we need to find the candidate keys first.

Candidate keys:

 ABCD (since all attributes together form a trivial superkey)


 AB (by the FD AB → C and augmentation to get ABD → CD)
 BC (by the FD C → D and augmentation to get BCD → A)
The minimal candidate keys are the keys of R:

 AB
 BC

c) Superkeys of R that are not keys: Superkeys are the supersets of keys that uniquely identify each tuple.
From the keys found in part (b), the superkeys that are not keys are:

 ABCD
 ABC
 ABD
 BCD

Ex 3.2.2:

i) S(A, B, C, D) with FDs A → B, B → C, and B → D.

a) Nontrivial FDs with single attributes on the right side:

 A → B (given)
 B → C (given)
 B → D (given)
 AB → C (by augmentation from B → C)
 AB → D (by augmentation from B → D)
 A → D (by transitivity from A → B and B → D)

b) Keys of S: Candidate keys:

 ABCD (trivial superkey)


 AB (by the FDs A → B, AB → C, and AB → D)
 A (by the FDs A → B and A → D)

The minimal candidate key is the key of S:

 A

c) Superkeys of S that are not keys:

 ABCD
 ABC
 ABD
 BD

ii) T(A, B, C, D) with FDs AB → C, BC → D, CD → A, and AD → B.

a) Nontrivial FDs with single attributes on the right side:

 AB → C (given)
 BC → D (given)
 CD → A (given)
 AD → B (given)
 ABC → D (by transitivity from AB → C and BC → D)
 BCD → A (by transitivity from BC → D and CD → A)
 ABD → B (by transitivity from AB → C, BC → D, and CD → A)
b) Keys of T: Candidate keys:

 ABCD (trivial superkey)


 ABC (by the FDs AB → C and ABC → D)
 BCD (by the FDs BC → D and BCD → A)

The minimal candidate keys are the keys of T:

 ABC
 BCD

c) Superkeys of T that are not keys:

 ABCD

iii) U(A, B, C, D) with FDs A → B, B → C, C → D, and D → A.

a) Nontrivial FDs with single attributes on the right side:

 A → B (given)
 B → C (given)
 C → D (given)
 D → A (given)
 AB → C (by augmentation from B → C)
 AC → D (by transitivity from A → B and B → C)
 BC → A (by transitivity from B → C and C → D)
 BD → A (by augmentation from D → A)
 ABC → D (by transitivity from AB → C and AC → D)
 ABD → C (by augmentation from AB → C)

b) Keys of U: Candidate keys:

 ABCD (trivial superkey)


 ABC (by the FDs AB → C and ABC → D)
 BCD (by the FDs BC → A, C → D, and BCD → A)

The minimal candidate keys are the keys of U:

 ABC
 BCD

c) Superkeys of U that are not keys:

 ABCD
 ABD
 ACD
 BCD (note that BCD is both a key and a superkey)
Ex 3.2.10

a) AB → DE, C → E, D → C, and E → A.

In the projected relation S(A, B, C), the FDs that hold are:

 AB → C (derived from AB → DE and D → C)


 C → C (trivial)

Minimal basis: {AB → C}

b) A → D, BD → E, AC → E, and DE → B.

In the projected relation S(A, B, C), the FDs that hold are:

 A → B (derived from A → D and DE → B)


 AC → B (derived from AC → E and DE → B)

Minimal basis: {A → B}

c) AB → D, AC → E, BC → D, D → A, and E → B.

In the projected relation S(A, B, C), the FDs that hold are:

 AB → C (derived from AB → D and BC → D)


 AC → B (derived from AC → E and E → B)
 BC → A (derived from BC → D and D → A)

Minimal basis: {AB → C, AC → B}

d) A → B, B → C, C → D, D → E, and E → A.

In the projected relation S(A, B, C), the FDs that hold are:

 A → B (given)
 B → C (given)
 A → C (derived from A → B and B → C)

Minimal basis: {A → B, B → C}

You might also like