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 FD¡¯s by giving example relations
that satisfy the given FD¡¯s (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)