



Study with the several resources on Docsity
Earn points by helping other students or get them with a premium plan
This page cannot be seen from the preview
Don't miss anything!




1. Misc Questions [5]
The order of rows in a relation is important: TRUE or FALSE A relation can have two columns with the same name TRUE or FALSE A relation can have an extension with no tuples. TRUE or FALSE
h) Circle TRUE or FALSE for the following statements:
A superkey is a set of one or more attributes that TRUE FALSE
identify an entity or relationship A candidate key is also a superkey TRUE FALSE A primary key is a candidate key TRUE FALSE A primary key is a superkey TRUE FALSE
A minimal superkey is a candidate key TRUE FALSE A foreign key is a primary key of some relation TRUE FALSE A relation can have at most one foreign key. TRUE or FALSE
i) A query language called Quel has queries of the form:
range of s is borrower range of t is loan retrieve (t.customer-name) where s.branch-name="Perryridge" and t.loan-number=s.loan-number Is Quel a procedural or a non-procedural language? Circle one: PROCEDURAL NON-PROCEDURAL
Is Quel a tuple or a domain calculus language? TUPLE DOMAIN
3. Functional Dependencies [7] Consider the following relation and the functional dependencies on it:
R(A,B,C,D,E,) : A Æ BC CD Æ E B Æ D E Æ A
a) Show that there are not any extraneous attributes in the above FD’s. Illustrate for each possible extraneous attribute that it is not.
b) Find all candidate keys. Then argue why there cannot be a candidate key with three attributes.
c) [.5] Is R in BCNF? Explain.
d) [.5] Is R in 3NF?
e) Is the decomposition R1(A,B,C) and R2(A,D,E) of R LOSSLESS or LOSSY? Circle and justify.
Is this decomposition FD preserving? YES or NO If you answer is NO, what is not preserved?
Is the decomposition R3(A,B,C,D) and R4(C,D,E) of R LOSSLESS or LOSSY? Circle and justify.
Is this decomposition FD preserving? YES or NO If you answer is NO, what is not preserved?
f) What is R1? Circle your answer BCNF 3NF NONE OF THESE
What is R2? Circle your answer BCNF 3NF NONE OF THESE
What is R3? Circle your answer BCNF 3NF NONE OF THESE
What is R4? Circle your answer BCNF 3NF NONE OF THESE
g) Using the decomposition algorithm decompose R into a lossless and BCNF relations. Then check if they it is FD preserving. ===================================================================================== h) [0 points just for fun] Compare the decomposition you obtain above with this R3(A,B,C,D) R4(C,D,E). Which of these two decompositions uses more storage for the same number of tuples in the original relation R?
s1 microsoft bad redwood j1 abb washington s2 halliburton excellent Nassau j2 shock bagdad s3 ibm good sanjose j3 tiger rome
P( P# , PNAME, COLOR, WEIGHT, CITY ) SPJ( S#, P#, J#, QTY )
p1 winXP blue 2 mandras s1 p2 j1 10 p2 as400 red 6 sanjose s2 p1 j2 20 p3 perl yellow 2 brighton s2 p4 j2 70 p4 oracle green 9 sanmateo s3 p1 j1 40
J.J# = SPJ.J#