Consider a relational schema π = (π,π,π,π,π,π) on which the followingβ¦
2020
Consider a relational schemaΒ π = (π,π,π,π,π,π)Β on which the following functional dependencies hold:
(πβπ,ππβπ,πβπ,πβπ)
Which are the candidate keys among following options?
- A.
ππ,ππ
- B.
ππ,ππ,ππ
- C.
πππ,πππ,πππ
- D.
πππ,πππ,πππ
Attempted by 900 students.
Show answer & explanation
Correct answer: D
Answer: The candidate keys are U Y Z, V Y Z, and X Y Z.
Key idea: Use attribute closure and the given dependencies: U β V, VW β X, Y β W, X β U.
For X Y Z: compute closure. X β U, then U β V, and Y β W. With V and W we have VW β X (already present). Thus XYZ+ = {U, V, W, X, Y, Z} (all attributes). Removing any attribute breaks this: X Y lacks Z, X Z lacks Y, and Y Z lacks X, so minimality holds.
For U Y Z: compute closure. U β V and Y β W. With V and W we get VW β X, and X β U gives no new attribute. So UYZ+ = {U, V, W, X, Y, Z}. Removing any attribute prevents deriving the missing one (for example, UY lacks Z), so U Y Z is minimal.
For V Y Z: compute closure. Y β W, and with V and W we get VW β X, then X β U and U β V. So VYZ+ = {U, V, W, X, Y, Z}. Removing any attribute prevents deriving the missing one (for example, VY lacks Z), so V Y Z is minimal.
Why other sets fail: Any set that does not include Z cannot produce Z because no functional dependency yields Z. Some sets without Z can generate many other attributes (e.g., X Y or U Y produce U, V, W, X, Y), but they remain incomplete without Z.
A video solution is available for this question β log in and enroll to watch it.