GATE / CS ARCHIVE

GATE CSE 1995 / QUESTION 26(b)

Finding all minimal keys

Database Management Systems · Functional Dependencies & Keys · Full GATE CSE 1995 paper

GATE 1995, Q26(b) Descriptive
Report issue

Functional Dependencies & Keys

Question 26(b), GATE 1995: For R(A,B,C), with AB→C and C→A, determine every minimal key.
Question 26(b), GATE 1995: For R(A,B,C), with AB→C and C→A, determine every minimal key.
Tap to enlarge
Answer & solution

Answer: AB and BC are exactly the candidate keys. (no official key was published)

Step through it (4 steps)

A candidate key must determine all three attributes, and none of its proper subsets may do so. Since B does not occur on the right side of either given functional dependency, starting from attributes that omit B can never derive B. Thus every key must contain B. The closure B+ is just {B}, so B by itself is not enough.

Add A: (AB)+ initially contains A,B and then AB→C adds C, so AB is a superkey. Removing A leaves B+, which lacks A,C; removing B leaves A+={A}. Therefore AB is minimal. Add C instead: (BC)+ contains B,C, then C→A adds A, so BC is a superkey. Removing B leaves C+={C,A}, and removing C leaves B+={B}; neither is all of R. Thus BC is minimal.

These are exhaustive. Any key must contain B and at least one of the other two attributes. Such a set therefore contains AB or BC. The only larger possibility ABC is a superkey but not a minimal key, because either of those proper subsets already determines R. Hence the complete candidate-key set is {AB,BC}, not just the first key suggested by the dependency AB→C. No extra dependencies are assumed.

Original paper, page 8