ITPEC FE Morning April 2023 Question 26
Which of the following is the key of a relation schema R = (M, N, O, P, S, T), when R has the functional dependencies shown below?
O → T
S → M
OS → P
M → N
Explanation
OS — O and S together determine every attribute of R, and neither does alone.
O and S never appear on the right side of a dependency, so nothing else can derive them and every key must contain both. Their closure:
- •Start with O and S
- •O → T adds T
- •S → M adds M
- •OS → P adds P
- •M → N adds N, so all six attributes are reached
Dropping O loses T and P; dropping S loses M, N and P. So OS is minimal, a candidate key.
Answer (d)
Why not others:
- •(a) MO — reaches only M, N, O, T; without S, P cannot be derived.
- •(b) MS — reaches only M, N, S; without O neither T nor P follows.
- •(c) OP — reaches only O, P, T; without S neither M nor N follows.
Key rule: An attribute that never appears on the right side of any functional dependency belongs to every candidate key; start from those attributes and compute their closure.
Databases · AI-written, may contain errors
This question comes from an official ITPEC past paper. ITPEC Practice is an independent study tool and is not affiliated with ITPEC. See the official FE past-paper collection or Report an issue.