GateAI
Integrity Constraints and Normal Forms

GATE CSE 2026 Set 1 · Q65

NAT2 marksEasy

Time

Consider a relational database schema with a relation R(A,B,C,D)R(A, B, C, D). If {A,B}\{A, B\} and {A,C}\{A, C\} are the only two candidate keys of the relation RR, then the number of superkeys of relation RR is ________. (answer in integer)

Your answerNumerical answer

Enter a value to check

Solution

Step-by-step verified solution

Official answer: 6

Integrity Constraints and Normal Forms

A superkey is any superset of a candidate key.

The relation has 4 attributes: U={A,B,C,D}U = \{A, B, C, D\}. The given candidate keys are K1={A,B}K_1 = \{A, B\} and K2={A,C}K_2 = \{A, C\}.

  1. Supersets containing K1={A,B}K_1 = \{A, B\}: The remaining attributes are {C,D}\{C, D\} (2 attributes).

    Number of superkeys containing {A,B}=22=4\text{Number of superkeys containing } \{A, B\} = 2^2 = 4

    These are: {A,B},{A,B,C},{A,B,D},{A,B,C,D}\{A, B\}, \{A, B, C\}, \{A, B, D\}, \{A, B, C, D\}.

  2. Supersets containing K2={A,C}K_2 = \{A, C\}: The remaining attributes are {B,D}\{B, D\} (2 attributes).

    Number of superkeys containing {A,C}=22=4\text{Number of superkeys containing } \{A, C\} = 2^2 = 4

    These are: {A,C},{A,B,C},{A,C,D},{A,B,C,D}\{A, C\}, \{A, B, C\}, \{A, C, D\}, \{A, B, C, D\}.

  3. Supersets containing both {A,B}\{A, B\} and {A,C}\{A, C\}, i.e., containing {A,B,C}\{A, B, C\}: The remaining attribute is {D}\{D\} (1 attribute).

    Number of superkeys containing both =21=2\text{Number of superkeys containing both } = 2^1 = 2

    These are: {A,B,C},{A,B,C,D}\{A, B, C\}, \{A, B, C, D\}.

By the Principle of Inclusion-Exclusion:

Total superkeys=∣S(AB)∣+∣S(AC)∣−∣S(AB)∩S(AC)∣\text{Total superkeys} = |S(AB)| + |S(AC)| - |S(AB) \cap S(AC)|
Total superkeys=4+4−2=6\text{Total superkeys} = 4 + 4 - 2 = 6

Try the question first, then check your work.

Think the official key or this write-up is wrong?

Report error or challenge

Examiner trap

The misconception this question tests

This Integrity Constraints and Normal Forms previous year question is Q65 of the GATE CSE 2026 Set 1 paper. Find more GATE CSE PYQs on Integrity Constraints and Normal Forms in Databases, or browse all GATE CSE PYQs.

Free diagnostic

Where do you stand for GATE?

Take the 20-minute diagnostic: the 3 topics that cost you the most marks, and a rank range. Or sit 5 related Integrity Constraints and Normal Forms PYQs now with no account.

One GATE CSE PYQ every morning

An official question by email at 7 AM IST, with a link to its verified solution. Unsubscribe in one click.

Integrity Constraints and Normal Forms in GATE CSE

Integrity Constraints and Normal Forms has 30 GATE CSE PYQs across 20 papers from 2011 to 2026. 2 of them are 2-mark NAT questions like this one, and GATE CSE 2026 Set 1 has 3.

How GATE tests Integrity Constraints and Normal Forms

More from GATE CSE 2026 Set 1

Share this solution

A plain-text card for WhatsApp or Telegram study groups.

GateAI solution cardGATE CSE 2026 Set 1 · Q65 · NAT

Consider a relational database schema with a relation R(A, B, C, D). If {A, B} and {A, C} are the only two candidate keys of the relation R, then the number of superkeys of relation R is … (answer in integer)

Topic-wise GATE CS PYQs with verified steps

Independent practice explanation verified by the GateAI team. GATE is conducted by the IITs; question text follows the official paper.