Chap7 Practice Key
Chap7 Practice Key
1. Given the relation schema R = (A, B, C, D, E) and the canonical cover of its set of
functional dependencies
Fc = { A → BC
CD → E
B→D
E→A }
Compute a lossless join decomposition in Boyce-Codd Normal Form for R. Show your
steps clearly to get full marks!
2. Note that we are given the canonical cover Fc in the question. This means
that we can avoid computing the closure of F and just use Fc and
Armstrong's axioms to determine if a given functional dependency is in F+.
A → BC given
A → B, A → C decomposition
B → D, so A → D given, transitive
A → CD union
CD → E, so A → E transitive
A → ABCDE union of above steps
E → A, so E → ABCDE given, transitive
CD → E, so CD → ABCDE transitive
B → D, so BC → CD augmentation
BC → ABCDE transitive
a) Give a primary key of the relation r(name, address, gender, rank, salary). Prove your
answer formally using Armstrong's Axioms.
name is the primary key. To prove this, first prove that name is a
superkey, then prove it is a candidate key and finally a primary key.
From the given FD's, it is not possible to have an FD that only has 'name'
on its right-hand side, therefore, the attribute name must be part of any
superkey. As the definition of a candidate key is a minimal superkey and
{name} is a superkey, and the empty set is not a superkey, 'name' must be
a candidate key.
Since name is a candidate key and it is the only candidate key, it is also
the primary key.
b) (5 marks) Normalize the relation r(name, address, gender, rank, salary) to 3rd normal
form, ensuring that the resulting relations are dependency-preserving and lossless-join
decompositions. Specify the primary keys in the normalized relations by underlining
them.
Use the algorithm on page 230 of the text to work through the
decomposition. Note that the fd's given form a canonical cover Fc, so one
possible decomposition is as follows:
To show that two relations r1 and r2 form a lossless join, we must show
one of the following:
r1 ∩ r2 → r1
r1 ∩ r2 → r2