Consider a relation with the following three functional dependencies.
The number of superkeys in the relation R is ______.
Consider a relation with the following three functional dependencies.
The number of superkeys in the relation R is ______.
ANSWER
The relation R has 8 superkeys.
Official answer: 8Source: Official answer key, GATE 2022 CS (IIT Kharagpur)
Find the attributes that never appear on a right-hand side. and appear only on left sides, so no dependency can derive them. Every key must therefore contain both and .
Compute the closure of . Start with . Using add , giving . Using add . Using add .
So , which is all of . Hence is a superkey. Any key must contain , so no proper subset of is a key, and is the only candidate key.
A superkey is any set of attributes that contains a candidate key. Here that means any set containing both and , with each of free to be present or absent. A superset of has closure because the closure of a superset contains .
Count: superkeys, namely , , , , , , , . Any set missing or cannot be a superkey, since its closure never gains the missing attribute.
KEY IDEA
Attributes that never appear on a right-hand side must be in every key. Here that is , and it already has closure . Every superkey is a superset of the candidate key, so the count is .
WATCH OUT FOR
Counting only the candidate key, or counting together with a few supersets. A superkey is any superset of a candidate key, so all supersets of count.
From the GATE 2022 CS paper. Every question of this paper · Download the full paper · All 19 Normal forms questions, with notes