Database Assignment #3 Exercises

 

Exercise 3.2.1

Exercise 3.2.2

Exercise 3.2.6

Exercise 3.3.1

Exercise 3.4.1

Exercise 3.5.3

These exercises are found in the textbook (3rd edition).

Submission Due Date: Nov. 14 (before the class)

 

Exercise 3.2.1(3rd edition) Exercise 3.6.1 (2rd edition). 3.5.1 ()

Exercise 3.2.2(3rd edition) Exercise 3.6.2 (2rd edition). 3.5.2 ()

Exercise 3.2.6 (3rd edition) : Show that each of the following are not valid rules about FDs by giving example relations that satisfy the given FDs (following the if) but not the FD that allegedly follows (after the then).

a) If AB C, then A C or B C.

b) If A B then B A.

c) If AB C and A C, then B C.

 

Exercise 3.3.1 (3rd edition) : For each of the following relation schemas and sets of FD's:

a) R(A, B, C, D) with FD's B A, C B, D C, and A D.

b) R(A, B, C, D) with FD's BC D, D A, and A B.

c) R(A, B, C, D) with FD's A B and A C

d) R(A, B, C, D) with FD's AB D, BD C. CD A, and AC B.

e) R(A, B, C, D, E) with FD's AB C, C E, E A, and E D.

f) R(A, B, C, D, E) with FD's AB C, DE C, B E.

do the following:

i)             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.

ii)            Decompose the relations, as necessary, into collections of relations that are in BCNF.

Exercise 3.4.1 (3rd edition): 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 lossless. For those that are not lossless, give an example of an instance of R that returns more than R when projected onto the decomposed relations and rejoined.

a) BC D and AC E.

b) B E, E D and B E.

c) B E, CE D and D E.

d) A D and CD B.

Exercise 3.5.3 (3rd edition) : Consider the relation Courses(C, T, H, R, S, G), whose attributes may be thought of informally as course, teacher, hour, room, student, and grade. Let the set of FD's for Courses be C T, HR C, HT R, HS R, and CS G. Intuitively, the first says that a course has a unique teacher, and the second says that only one course can meet in a given room at a given hour. The third says that a teacher can be in only one room at a given hour, and the fourth says the same about students. The last says that students get only one grade in a course.

a) What are all the keys for Courses?

b) Verify that the given FD's are their own minimal basis.

c) Use the 3NF synthesis algorithm to find a lossless-join, dependency-preserving decomposition of R into 3NF relations. Are any of the relations not in BCNF?

Due Date: Dec. 3 (Before the class)

 

Attached File