$6.99
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:
a) Indicate all the BCNF violations. 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?
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:
a) B à E and CE à A
b) AC à E and BC à D
c) A à D, D à E, and E à D
d) A à D, CD à E, and E à D.
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:
a) Find the address of MGM studios?
b) Find Sandra Bullock’s birthdate?
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:
a) Who were the male stars in Titanic?
b) Which stars appeared in movies produced by MGM in 1995?
c) Who is the president of MGM studio?
d) Which movies are longer than “Gone With the Wind”?