Docsity

Database Design Homework Solutions, Assignments of Deductive Database Systems

Toggle sidebar
bg1
Homework 2 Solutions
Notice that for some questions the provided answer may not be the only correct answer.
We will look through your answers, if different, to see if they are correct or not.
1)
Musician (SSN, address, s-name)
Instrument (instr-id, i-name, key)
The next two relation schemas would be
Song (song-id, title, p-name)
Publicist (p-name, p-agency)
Or
Song (song-id, title)
Publicist (p-name, p-agency, song-id)
Weak entity:
Single (track-name, song-id, year)
Is-A (ER-style):
Band-Leader (SSN, band-name)
Many-to-many relationship:
Performs (SSN, song-id)
Plays (SSN, instr-id)
2) If there is atmost one nontrivial FD it must be the FD K -> R' where key is set of key
attributes and R' is the set of all other attributes.
If the given FD was not of this form then we can always use Armstrongs Axioms of FDs
to reach to these FDs.
The FD K -> R' satisfies the condition that LHS of the FD should be a superkey. Hence
the given schema is in BCNF.
3)
1. keys: ZUV, XZU, YZU
2. R is not in BCNF since X, YZ, and VU are not a superkey.
3. R is in 3NF because Y, V, and X are all parts of keys.
4)
X->Y: cannot say anything
X->->Y cannot say anything
YZ->X does not hold since in the tuples (123) and (423), the YZ values are the same by
X values differ.
YZ ->->X can not say anything
Y->Z does not hold (as in tuples (533) and (534)
Y->->Z can not say anything. the tuples (533) and (534) could shed some light if their X
values differed but that is not the case, here.
pf2

Partial preview of the text

Download Database Design Homework Solutions and more Assignments Deductive Database Systems in PDF only on Docsity!

Homework 2 Solutions

Notice that for some questions the provided answer may not be the only correct answer. We will look through your answers, if different, to see if they are correct or not.

Musician (SSN, address, s-name) Instrument (instr-id, i-name, key) The next two relation schemas would be Song (song-id, title, p-name) Publicist (p-name, p-agency) Or Song (song-id, title) Publicist (p-name, p-agency, song-id) Weak entity: Single (track-name, song-id, year) Is-A (ER-style): Band-Leader (SSN, band-name) Many-to-many relationship: Performs (SSN, song-id) Plays (SSN, instr-id)

2) If there is atmost one nontrivial FD it must be the FD K -> R' where key is set of key attributes and R' is the set of all other attributes. If the given FD was not of this form then we can always use Armstrongs Axioms of FDs to reach to these FDs. The FD K -> R' satisfies the condition that LHS of the FD should be a superkey. Hence the given schema is in BCNF.

3)

  1. keys: ZUV, XZU, YZU
  2. R is not in BCNF since X, YZ, and VU are not a superkey.
  3. R is in 3NF because Y, V, and X are all parts of keys.

4) X->Y: cannot say anything X->->Y cannot say anything YZ->X does not hold since in the tuples (123) and (423), the YZ values are the same by X values differ. YZ ->->X can not say anything Y->Z does not hold (as in tuples (533) and (534) Y->->Z can not say anything. the tuples (533) and (534) could shed some light if their X values differed but that is not the case, here.

  1. a: Y - b:it is 2NF not 3NF - c: Z->W and Z->X violate BCNF. one way to obtain a lossless join preserving decomposition could be: XZ, YZ, ZW
  2. a:YW - b:it is in 1NF not 2NF - c: Y->Z and W->X violate BCNF. decomposition: XW, YZ, YW
  3. a: XYZ, YZW - b: in 3NF not in BCNF. c: W->X and W is not a key. but there is no BCNF decomposition since if we split R into XW, YZW we cannot preserve the dependency XYZ -> W.
  4. a: X - b: in 2NF but not in 3NF (because of the FD:YZ->W) c: YZ->W violates BCNF since YZ does not contain a key. So we split up R as in : YZW, XYZ
  5. a: XY, YZ, ZW, WX - b: in 3NF not in BNCF (because of the FD: Z->X) - c: Z->X , W->Y are both violation. So decompose into: XZ, YZW but this does not preserve XY-

Z and XY->W, and YZW is still not in BCNF (w->Y). So decompose further to XZ,

YW, ZW and add the XYZ and XYW to get the final BCNF , lossless and join- preserving.