IAE Academy

GATE 2022 CS Q.31: solution and answer

GATE 2022 · CSQ.31 · 1 mark · NAT

Consider a relation with the following three functional dependencies.

The number of superkeys in the relation R is ______.

See the question in the paper

Answer and solution

ANSWER

The relation R has 8 superkeys.

Official answer: 8Source: Official answer key, GATE 2022 CS (IIT Kharagpur)

  1. 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 .

  2. Compute the closure of . Start with . Using add , giving . Using add . Using add .

  3. 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.

  4. 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 .

  5. 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

More Normal forms questions