Homework #2 Solution

$35.00 $24.00

Questions on Chapters (3 + 6):   Please answer the following questions:          Q1 [1.5 pts]: For each of the following relation schemas and set of FD’s:   o R(A,B,C,D) with FD’s AB à C, C à D, and D à A o R(A,B,C,D) with FD’s B à C and B à D…

You’ll get a: . zip file solution

 

 
Categorys:

Description

5/5 – (2 votes)

Questions on Chapters (3 + 6):

 

Please answer the following questions:

 

 

     Q1 [1.5 pts]: For each of the following relation schemas and set of FD’s:

 

o R(A,B,C,D) with FD’s AB à C, C à D, and D à A

o R(A,B,C,D) with FD’s B à C and B à D

o R(A,B,C,D) with FD’s AB à C, BC à D, CD à A and AD à B

o R(A,B,C,D) with FD’s A à B, B à C, C à D and D à A

o R(A,B,C,D,E) with FD’s AB à C, DE à C, and B à D

o R(A,B,C,D,E) with FD’s AB à C, C à D, Dà B, and D à E Do the following:

  1. a) Indicate all the BCNF violation Do not forget to consider FD’s that

are not in the given set, but follow from them. However, it is not necessary to give violations that have more than one attribute on the right side?

  1. b) Decompose the relations, as necessary, into collections of relations that are in BCNF?

 

 

 Q2 [1 pt]: Let R(A,B,C,D,E) be decomposed into relations with the following three sets of attributes: {A,B,C}, {B,C,D}, and {A,C,E}. For each of the following sets of FD’s, use the chase test to tell whether the decomposition of R is loosless. For those that are not loosless, give an example of an instance of R that returns more

than R when projected onto the decomposed relations and rejoined:

  1. a) B à E and CE à A

 

  1. b) AC à E and BC à D
  2. c) A à D, D à E, and E à D
  3. d) A à D, CD à E, and E à

 

 

 Q3 [1.5 pts]: Write the following queries based on the following schema:

Movies(title, year, length, genre, studioName, producerC#)

StarsIn(movieTitle, movieYear, starName) MovieStar(name, address, gender, birthdate) MovieExec(name, address, cert#, netWorth) Studio(name, address, presC#)

in SQL:

  1. a) Find the address of MGM studios?
  2. b) Find Sandra Bullock’s birthdate?
  3. c) Find all the stars that appeared either in a movie made in 1980

or a movie with “Love” in the title?

 

 

 Q4 [1 pt]: Write the following queries based on the following schema:

Movies(title, year, length, genre, studioName, producerC#)

StarsIn(movieTitle, movieYear, starName) MovieStar(name, address, gender, birthdate) MovieExec(name, address, cert#, netWorth) Studio(name, address, presC#)

Write the following queries in SQL:

  1. a) Who were the male stars in Titanic?
  2. b) Which stars appeared in movies produced by MGM in 1995?
  3. c) Who is the president of MGM studio?

 

  1. d) Which movies are longer than “Gone With the Wind”?