Docsity

Assignment 4 for Database Systems | CS 430, Assignments of Deductive Database Systems

Toggle sidebar
bg1
CS 430 Database Systems
Homework Assignment 4 - Due 02/26/2009
1. (a) Does the FD X โ†’Z follow from {Xโ†’Y, X โ†’W, WY โ†’Z}?
(b) Does the FD XW โ†’Z follow from {XY โ†’Z, Y โ†’W, WY โ†’Z}?
2. Consider the relation rbelow:
A B C D E
a1b1c1d1e1
a1b2c2d2d1
a2b1c3d3e1
a2b1c4d3e1
a3b2c5d1e1
Which of the following FDs does rsatisfy: A โ†’B, AD โ†’B, C โ†’DE, CD
โ†’A, AE โ†’B?
3. Let F = {Aโ†’B, AB โ†’E, BG โ†’E, CD โ†’I, E โ†’C}. Compute A+,
(AE)+, and (ADE)+.
4. Let F = {Aโ†’C, AC โ†’D, E โ†’AD}, and let G = {Aโ†’CD, E โ†’AHE}.
Are they equivalent?
5. Find a minimal cover for each of the following.
(a) {Aโ†’BC, B โ†’C, AB โ†’D}
(b) {Aโ†’C, AB โ†’C, C โ†’DI, CD โ†’I,EC โ†’AB, EI โ†’C}
6. Determine if the following decompositions are lossless join decompositions:
(a) R = ABCD, F = {Bโ†’C, AD โ†’C},ฯ={AB,BCD}
(b) R = ABCDEI, F = {Aโ†’D, B โ†’E, C โ†’I},ฯ={ABC, ADI, BDEI,
CDEI}.
1
pf2

Partial preview of the text

Download Assignment 4 for Database Systems | CS 430 and more Assignments Deductive Database Systems in PDF only on Docsity!

CS 430 Database Systems

Homework Assignment 4 - Due 02/26/

  1. (a) Does the FD X โ†’ Z follow from {X โ†’ Y, X โ†’ W, WY โ†’ Z}? (b) Does the FD XW โ†’ Z follow from {XY โ†’ Z, Y โ†’ W, WY โ†’ Z}?
  2. Consider the relation r below: A B C D E a 1 b 1 c 1 d 1 e 1 a 1 b 2 c 2 d 2 d 1 a 2 b 1 c 3 d 3 e 1 a 2 b 1 c 4 d 3 e 1 a 3 b 2 c 5 d 1 e 1 Which of the following FDs does r satisfy: A โ†’ B, AD โ†’ B, C โ†’ DE, CD โ†’ A, AE โ†’ B?
  3. Let F = {A โ†’ B, AB โ†’ E, BG โ†’ E, CD โ†’ I, E โ†’ C}. Compute A+, (AE)+, and (ADE)+.
  4. Let F = {A โ†’ C, AC โ†’ D, E โ†’ AD}, and let G = {A โ†’ CD, E โ†’ AHE}. Are they equivalent?
  5. Find a minimal cover for each of the following.

(a) { A โ†’ BC, B โ†’ C, AB โ†’ D} (b) {A โ†’ C, AB โ†’ C, C โ†’ DI, CD โ†’ I,EC โ†’ AB, EI โ†’ C}

  1. Determine if the following decompositions are lossless join decompositions:

(a) R = ABCD, F = {B โ†’ C, AD โ†’ C}, ฯ = {AB,BCD} (b) R = ABCDEI, F = {A โ†’ D, B โ†’ E, C โ†’ I}, ฯ = {ABC, ADI, BDEI, CDEI}.

  1. Let F = {AB โ†’ C, C โ†’ B, A โ†’ B}. Reverse steps 2 and 3 of the minimal cover algorithm given in class, and apply the modified algorithm to F. Is the resulting set a minimal cover of F?
  2. Suppose we have a database for an investment firm, consisting of the follow- ing attributes: B (broker), O (office of the broker), I (investor), S (stock), Q (quantity of stock owned by an investor), and D (dividend paid by a stock), with the following FDS: S โ†’ D, I โ†’ B, IS โ†’ Q, and B โ†’ O. (a) Find a key for the relation scheme R = BOSQID. (b) How many keys does R have? Justify your answer. (c) Find a lossless join decomposition into BCNF. (d) Find a decomposition of R into 3NF, having a lossless join and preserv- ing dependencies.
  3. Consider the relation scheme ASSIGN (EMP ID, PROJECT, PROJECT BUDGET, TIME SPENT BY PERSON ON PROJECT) containing the following FDs: EMP ID, PROJECT โ†’ TIME SPENT BY PERSON ON PROJECT PROJECT โ†’ PROJECT BUDGET (a) State which attributes of ASSIGN are prime and which are nonprime. (b) Is ASSIGN in 3NF? (c) What about BCNF? Please keep in mind:
  • This assignment is to be done individually. The honor code is in effect.
  • You must submit a hard copy of the assignment in class.
  • Assignments must be submitted before class on Thursday, February 26. No late work will be accepted except in exigent situations.
  • Your answers must be typed.