In the BCNF decomposition algorithm, suppose you use a functional dependency to decompose a relation schema into and .
a. What primary and foreign-key constraint do you expect to hold on the decomposed relations?
b. Give an example of an inconsistency that can arise due to an erroneous update, if the foreign-key constraint were not enforced on the decomposed relations above.
c. When a relation schema is decomposed into 3NF using the algorithm in Section 7.5.2, what primary and foreign-key dependencies would you expect to hold on the decomposed schema?
a. should be a primary key for , and should be the foreign key from , referencing .
b. If the foreign key constraint is not enforced, then a deletion of a tuple from would not have a corresponding deletion from the referencing tuples in . Instead of deleting a tuple from , this would amount to simply setting the value of to null in some tuples.
c. For every schema added to the decomposition because of a functional dependency , should be made the primary key. Also, a candidate key for the original relation is located in some newly created relation and is a primary key for that relation. Foreign-key constrains are created as follows: for each relation created above, if the primary key attributes of also occur in any other relation , then a foreign-key constraint is created from those attributes in , referencing (the primary key of) .