ITPEC FE Morning October 2020 Question 25
Which of the following is the key of the relation schema, R (A, B, C, P, Q, T), when R has the functional dependencies shown below?
A→B
A→C
CP→Q
CP→T
Explanation
{A, P} — together A and P determine every attribute of R, and neither does on its own.
A and P never appear on the right-hand side of a dependency, so nothing can derive them: every key must contain both. Compute the closure of {A, P}:
- •A → B and A → C add B and C
- •With C and P now known, CP → Q and CP → T add Q and T
- •The closure is {A, B, C, P, Q, T}, the whole relation
Dropping either attribute fails: A alone gives only {A, B, C}, and P alone gives nothing new. So {A, P} is a minimal key.
Answer (c)
Why not others:
- •(a) A — its closure {A, B, C} lacks P, so CP → Q and CP → T never fire and P, Q, T are missed
- •(b) A, B — B adds nothing A does not already give, and P is still missing, so the closure is again {A, B, C}
- •(d) C, P — its closure {C, P, Q, T} lacks A and B, because nothing determines A
Key rule: An attribute that never appears on the right-hand side of any functional dependency belongs to every key; start from those and check whether their closure already covers the relation.
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.