Consider the relation scheme ܴ\(R = (E, F, G, H, I, J, K, L, M, N)\) and the…
2014
Consider the relation scheme ܴ\(R = (E, F, G, H, I, J, K, L, M, N)\) and the set of functional dependencies
\(\left\{ \{E, F \} \to \{G\}, \{F\} \to \{I, J\}, \{E, H\} \to \{K, L\}, \ \{K\} \to \{M\}, \{L\} \to \{N\}\right\}\)
on \(R\). What is the key for \(R\)?
- A.
\(\{ E, F\}\) - B.
\(\{ E, F, H\}\) - C.
\(\{ E, F, H,K,L \}\) - D.
\(\{ E \}\)
Attempted by 700 students.
Show answer & explanation
Correct answer: B
Method: compute attribute closures to test candidate keys.
Test the set {E, F, H}:
Start with: {E, F, H}.
From F -> I, J add I and J: now have {E, F, H, I, J}.
From {E, F} -> G add G: now have {E, F, H, G, I, J}.
From {E, H} -> K, L add K and L: now have {E, F, H, G, I, J, K, L}.
From K -> M add M; from L -> N add N: closure becomes {E, F, G, H, I, J, K, L, M, N}.
Since the closure of {E, F, H} contains all attributes of R, {E, F, H} is a superkey.
Check minimality:
Remove H: closure of {E, F} yields {E, F, G, I, J} but not K, L, M, N, so {E, F} is not a key.
Remove F: closure of {E, H} yields {E, H, K, L, M, N} but not F, G, I, J, so {E, H} is not a key.
Remove E: closure of {F, H} yields {F, H, I, J} but not E, G, K, L, M, N, so {F, H} is not a key.
Because no proper subset of {E, F, H} determines all attributes, {E, F, H} is minimal and therefore is a candidate key (a key) for R.
Answer: the key for R is {E, F, H}.
A video solution is available for this question — log in and enroll to watch it.