Question
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)
Official answer and solution
- Official answer
- 6
- From
- Official GATE 2026 answer key
Solution
Use the principle of inclusion-exclusion to count all subsets of that contain at least one candidate key.
A subset is a superkey of if and only if contains or contains :
- Number of subsets containing : ()
- Number of subsets containing : ()
- Number of subsets containing both and (i.e., containing ): ()
By inclusion-exclusion, the total number of superkeys is .
Final answer
6
The answer is the one in the official GATE answer key. The solution is this site's own explanation.
Source
- Paper
- GATE 2026 Computer Science and Information Technology - Session 1 (CS1)
- Question
- 65 of 65
- Section
- Computer Science and Information Technology
Report an error in this question
GATE questions are the work of the organising institutes. This site is independent and is not affiliated with them.