Download as pdf or txt
Download as pdf or txt
You are on page 1of 3

CS 281 – Spring 2022

Homework 3

Question 1: [30 points] Find the candidate key(s) for the following relations.

a) R(A,B,C,D) F={D→ A, D →B, ABC → D, A → B, B→ CD}


b) R(A,B,C,D) F={A→ BCD, AB→ CD, ABC→ D, BD→ AB, C→ D}
c) R(A,B,C,D,E) F={AB→CD, D→ A, BC→DE}

Question 2: [10 points]

Given the relation R

A B C

a b c

a c b

a c b

c b a

c b c

Which of the following functional dependencies hold on R? Justify your answer

A→ B

BC→ A

AB→ C

C→ B

C→ A
Question 3: [10 points]
Given the relation R(A, B, C, D, E) and F = {ABC → BC, CE → AB, A → D}
Is this relation in BCNF? Explain why or why not. If not, decompose into smaller relations so
that it satisfies BCNF. In case you decompose it, is the decomposition lossless? Is it
dependency preserving? Justify your answer.

Question4: [15 points]


Given the relation R(X,Y,Z,T,K,L) and F = {XY → ZL, YZ → XTK, XZ→ L}
Is this relation in 3NF? Explain why or why not. If not, decompose into smaller relations so
that it satisfies 3NF. In case you decompose it, is the decomposition lossless? Is it
dependency preserving? Justify your answer.
Question5: [10 points]
Find the minimal cover for the following set of functional dependencies. Show your work in
each step:
R(A, B, C, D, E) with F={ D → C , AB → CD, B → DE, E → AB }

Question6: [15 points]

a) Build a B+ tree (d=1) with the following search key values in the given order using
repeated insertions:
16*, 21*, 15*, 23*, 18*, 13*, 7*, 32*, 25*, 20*, 17*

Show steps of your solution clearly


b) Delete the following search key values from the B+ tree that you built in (a):
25*, 7*

c) Use the bulk loading algorithm to insert the values given in part a. (d=2)

Question7: [10 points]


Insert the following key values into an extendible hash index with bucket capacity= 2 using
least significant bits. Start with global depth=1
8*, 25*, 7*, 28*, 18*, 20*, 10*, 32*

You might also like