ITPEC FE Subject A April 2026 Question 21
There is a relation schema A = (P, Q, R, S, T, Y) with functional dependencies below:
- •P → Q
- •QR → S
- •T → R
- •S → P
Which of the following is the candidate keys of A?
Explanation
PTY, QTY and STY — T and Y can never be derived, so every key contains them, and one of P, Q or S completes it.
First find the attributes that no dependency produces. Y appears in no functional dependency at all, and T appears only on a left-hand side, so both must belong to every candidate key. On their own they reach only T, Y and R (via T → R), so TY is not a key and one more attribute is needed. Test each addition by its closure:
- •PTY: P → Q adds Q, T → R adds R, QR → S adds S — all six attributes
- •QTY: T → R adds R, QR → S adds S, S → P adds P — all six
- •STY: S → P adds P, P → Q adds Q, T → R adds R — all six
- •RTY: R already follows from T, and nothing further is derived — not a key
Each of the three keys is minimal, because removing its middle attribute leaves TY.
Answer (d)
Why not others:
- •(a) PT, QT and (b) PT, QT, ST — leave out Y, which no dependency determines, so none of these even determines the whole relation
- •(c) PTY, QTY, QRY — QRY closes to Q, R, Y, S and P but never reaches T, and the key STY is missing
Key rule: An attribute that never appears on the right-hand side of a dependency must be in every candidate key; fix those first, then add one attribute at a time and test its 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.