Consider a relational database schema with a relation . If and are the only two candidate keys of the relation , then the number of superkeys of relation is ______. (answer in integer)
GATE 2026 CS1 Q.65: solution and answer
Answer and solution
ANSWER
The relation has 6 superkeys.
Official answer: 6Source: Official answer key, GATE 2026 CS1 (IIT Guwahati)
A superkey is any attribute set that contains a candidate key. The only candidate keys are and , so a set is a superkey exactly when it contains or contains .
Let be the family of supersets of . The attributes and may each be present or absent, so : .
Let be the family of supersets of . The attributes and are free, so : .
A set in both families contains , and , with free. So : and .
By inclusion–exclusion, .
Listing them: . There are 6 superkeys.
KEY IDEA
A superkey is any set that contains a candidate key. Count the supersets of each candidate key and use inclusion–exclusion so that sets containing both keys are not counted twice.
WATCH OUT FOR
Adding and forgetting that and contain both candidate keys. Another slip is to count only the candidate keys themselves, or to leave out the supersets that include .
From the GATE 2026 CS1 paper. Every question of this paper · Download the full paper · All 19 Normal forms questions, with notes
More Normal forms questions
- GATE 2026 DA Q.17 · MCQ · 1 markLet R(A,B,C,D,E) be a relational schema with functional dependency set F=A→BC, CD→E, E→A.
- GATE 2026 DA Q.26 · MSQ · 1 markConsider two relations r and s defined on the relational schemas R(A,B) and S(E,C), respectively.
- GATE 2025 CS1 Q.47 · MSQ · 2 marksConsider a relational schema team(name, city, owner), with functional dependencies name → city, name → owner.
- GATE 2025 CS2 Q.46 · MSQ · 2 marksConsider the following relational schema along with all the functional dependencies that hold on them.
