第1题:
[4 points] Consider the attribute set R = ABCDEF and the functional dependency set
F = {AD → B, A → E, C → E, DEF → A, F → D}. Find a candidate key of R.
FC
Notice that FC is not on the right-hand side of any of the given FDs. This means that any key of R must contain FC. Find the closure of FC to see that FC -> R. Thus, FC is a candidate key. Any other
key would be superkey, since a key must contain FC.
第2题:
[6 points] Given the attribute set R = ABCDEFGH and the functional dependency set
F = {BC → GH, AD → E, A → H, E → BCF, G → H}, decompose R into BCNF by decomposing in the
order of the given functional dependencies.
ADE, BCEF, GH, BCG
BC -> GH violates BCNF, decompose.
Relations: ABCDEF BCGH
AD -> E does not violate BCNF because AD is a superkey, skip.
A -> H No relation contains AH, skip.
E -> BCF violates BCNF, decompose.
Relations: ADE EBCF BCGH
G -> H violates BCNF, decompose.
ADE EBCF BCG GH
第3题:
[6 points] Given the attribute set R = ABCDEF and the functional dependency set
F = {B → D, E → F, D → E, D → B, F → BD}.
a) Is the decomposition ABDE, BCDF lossless?
b) If not, what functional dependency could you add to make it lossless?
a. No, it is lossy
ABDE ∩ BCDF = BD
BD -> BDEF, which is not equivalent to either ABDE or BCDF
b. Any or all of BDEF -> Any or all of AC
For example some valid answers were: B -> C, B -> A, BEFD -> AC, etc.
To be lossless, we want BD -> ABDE or BD -> BCDF. We know that BD ->
BDEF, so either want BD -> ABDEF or BD -> CBDEF (or both!).
This will be satisfied if BDEF -> A and/or C.