Consider a database relation R with attributes ABCDEFG, and having the following functional dependencies:
\[ \mathrm{A} \rightarrow \mathrm{BCEF} \qquad \mathrm{E} \rightarrow \mathrm{DG} \qquad \mathrm{BC} \rightarrow \mathrm{A} \]
Which of the following statements is/are correct?
Answer
(B), (D)
Explanation
Find the keys with attribute closures.
- \(\mathrm{A}^{+}\): A \(\rightarrow\) BCEF, then E \(\rightarrow\) DG, so \(\mathrm{A}^{+} = \mathrm{ABCDEFG}\) and A is a key.
- \(\mathrm{BC}^{+}\): BC \(\rightarrow\) A, and everything follows as above. \(\mathrm{B}^{+} = \mathrm{B}\) and \(\mathrm{C}^{+} = \mathrm{C}\), so BC is a candidate key.
- \(\mathrm{E}^{+} = \mathrm{DEG}\), so E is not a key.
A appears on a right side only in BC \(\rightarrow\) A, and B and C are determined only by A, so every key contains A or both B and C. The candidate keys are exactly A and BC: B holds, while A and C fail.
In E \(\rightarrow\) DG the left side E is not a superkey, so R is not in BCNF and D holds.
Answer: B, D