Super Key, Candidate Key & Primary Key MCQs: 12 Solved Questions

Solve 12 DBMS key MCQs with the deciding step shown for each answer. Practise minimality, attribute closure, superkey counting and primary-key rules.

KnowledgeGate Team

Exam prep & CS education

Updated 3 Aug 20268 min read

A super key guarantees uniqueness, a candidate key adds minimality, and a primary key is one selected candidate key. The confusion starts when a unique attribute set contains something removable, because that set stays a super key and stops being a candidate key. The deciding move is always the same: close the set, drop one attribute, and check whether uniqueness survives. KnowledgeGate's DBMS question bank carries 120+ questions on this subtopic, 80+ of them MCQs.

Super key, candidate key and primary key in 90 seconds

Consider this relation:

EnrollmentNo

Email

Name

101

ana@kg.ai

Ana

102

ravi@kg.ai

Ravi

103

meera@kg.ai

Meera

EnrollmentNo and Email are each unique. Therefore, the candidate keys are {EnrollmentNo} and {Email}. If we choose {EnrollmentNo} as the primary key, {Email} remains an alternate candidate key.

The six superkeys are {EnrollmentNo}, {Email}, {EnrollmentNo, Email}, {EnrollmentNo, Name}, {Email, Name}, and {EnrollmentNo, Email, Name}. {EnrollmentNo, Name} is a superkey but not a candidate key because removing Name still leaves the unique set {EnrollmentNo}. That removal test is minimality. If the hierarchy still feels shaky, work through the key lesson in the DBMS module first. That lesson is also where the rest of the practice on this subtopic sits.

MCQs 1-3: Definitions, minimality and implication

Remember the one-way rule: candidate key => superkey. The reverse fails whenever a unique set has a removable attribute.

Question 1

Consider the following statements about keys:

(I) A super key is an attribute or combination of attributes that uniquely identifies records in a RDBMS table.

(II) A candidate key is a subset of a super key.

(III) All super keys are candidate keys but vice versa is not true.

  • A. Only (I) is true

  • B. Only (II) is true

  • C. (I) and (III) are true

  • D. (I) and (II) are true

Answer: D. (I) and (II) are true.

Statement (I) gives the uniqueness test for a superkey. For (II), redundant attributes can be removed from a superkey until a minimal superkey, or candidate key, remains. Statement (III) reverses the implication: every candidate key is a superkey, but {EnrollmentNo, Name} shows why every superkey is not a candidate key.

Question 2

In relational database management, which of the following is/are property/properties of candidate key?

P : Uniqueness

Q : Irreducibility

  • A. P only

  • B. Q only

  • C. Both P and Q

  • D. Neither P nor Q

Answer: C. Both P and Q.

Uniqueness means the set identifies every tuple. Irreducibility means no proper subset can still do that. {EnrollmentNo, Name} has uniqueness but fails irreducibility, while {EnrollmentNo} satisfies both and is a candidate key. Again, a candidate key is always a superkey, but a superkey need not be minimal.

Question 3

Let x, y, z, a, b, c be the attributes of an entity set E. If {x}, {x,y}, {a,b}, {a,b,c}, {x,y,z} are superkeys then which of the following are the candidate keys?

  • A. {x,y} and {a,b}

  • B. {x} and {a,b}

  • C. {x,y,z} and {a,b,c}

  • D. {z} and {c}

Answer: B. {x} and {a,b}.

Cross out {x,y} and {x,y,z} because each contains the smaller superkey {x}. Cross out {a,b,c} because {a,b} is already a superkey. Thus {x} and {a,b} are the minimal choices, so they are candidate keys as well as superkeys.

MCQs 4-6: Prime attributes and candidate-key closures

For closure problems, first find attributes that never occur on a functional dependency's right-hand side. Then compute closure and test minimality separately.

Question 4

If AB and C are the candidate keys in a relation schema R(A,B,C,D), then what are the prime attributes?

  • A. A, B, and C only

  • B. A and B only

  • C. A and C only

  • D. B and C only

Answer: A. A, B, and C only.

A prime attribute belongs to at least one candidate key. AB contributes A and B, while candidate key C contributes C. Attribute D belongs to neither candidate key, so it is non-prime.

Question 5

Consider a relation scheme R = (A, B, C, D, E, H) on which the following functional dependencies hold: {A → B, BC → D, E → C, D → A}. What are the candidate keys of R?

  • A. AE, BE

  • B. AE, BE, DE

  • C. AEH, BEH, BCH

  • D. AEH, BEH, DEH

Answer: D. AEH, BEH, DEH.

E and H never occur on a right-hand side, so every candidate key must contain both. (AEH)+ adds B through A → B, C through E → C, and then D through BC → D. (BEH)+ adds C, then D, then A; (DEH)+ adds A, then B, while E adds C. All three closures reach {A,B,C,D,E,H}, and removing E, H, or the third attribute makes the closure incomplete.

Question 6

Consider a relation R with five attributes V, W, X, Y, and Z. The following functional dependencies hold:

VY → W, WX → Z, and ZY → V.

Which of the following is a candidate key for R?

  • A. VXZ

  • B. VXY

  • C. VWXY

  • D. VWXYZ

Answer: B. VXY.

Start with {V,X,Y}. VY → W adds W, and WX → Z then adds Z, so (VXY)+={V,W,X,Y,Z}. It is minimal because VY+={V,W,Y}, VX+={V,X}, and XY+={X,Y}. Options C and D contain VXY, so they are superkeys but not candidate keys.

MCQs 7-9: Closure chains and counting superkeys

Closure questions ask whether a set reaches every attribute and is minimal. Counting questions include every superset of a known candidate key.

Question 7

Consider a relation schema R=(U, V, W, X, Y, Z), on which the following functional dependencies hold: {U→V, VW→X, Y→W, X→U}. The candidate keys of R are:

  • A. UY, VY

  • B. UY, VY, XY

  • C. UYZ, VYZ, VWZ

  • D. UYZ, VYZ, XYZ

Answer: D. UYZ, VYZ, XYZ.

Y and Z cannot be derived, so both must be present. With Y → W, adding any one of U, V, or X completes the cycle U → V, VW → X, and X → U. Therefore UYZ, VYZ, and XYZ each reach all six attributes and are minimal. VWZ fails because nothing in its closure derives Y.

Question 8

Consider a relation R with attributes (A, B, C), where B is the only candidate key. Identify the total number of possible super keys of the relation R.

  • A. 1

  • B. 3

  • C. 4

  • D. 2

Answer: C. 4.

Every superkey must contain B. Attributes A and C are independently optional, giving 2^2=4 sets: {B}, {A,B}, {B,C}, and {A,B,C}. Only {B} is minimal. The other three are non-minimal superkeys.

Key lattice for R(A, B, C) where B is the only candidate key: {B} is minimal and its four superkeys are {B}, {A,B}, {B,C}, {A,B,C}.

Question 9

Consider a relation schema R with 4 attributes. If in this relation R every 2 attribute forms a candidate key, then total number of super keys are?

  • A. 64

  • B. 8

  • C. 20

  • D. 11

Answer: D. 11.

Every 2-attribute set is a candidate key, and every 3- or 4-attribute set contains one. Hence the total is C(4,2)+C(4,3)+C(4,4)=6+4+1=11. Singletons and the empty set are not superkeys under the stated premise.

MCQs 10-12: Inclusion-exclusion and primary-key integrity

When candidate-key families overlap, count their supersets with inclusion-exclusion. For primary keys, remember that one selected key may be composite, and none of its attributes may be NULL.

Question 10

How many superkeys possible if R(ABCDE) and candidate key {A, BC}?

  • A. 18

  • B. 20

  • C. 22

  • D. 24

Answer: B. 20.

Read {A, BC} as two candidate keys, {A} and {B,C}. Supersets containing A number 2^4=16, while those containing both B and C number 2^3=8. Their overlap contains A,B,C, with D and E optional, so it has 2^2=4 sets. Inclusion-exclusion gives 16+8-4=20.

Question 11

How many primary keys can be there in a table?

  • A. Only 1

  • B. Only 2

  • C. Depends on number of columns

  • D. More than one of the above

  • E. None of the above

Answer: A. Only 1.

A table can have several candidate keys, but the designer selects one primary-key constraint. That selected key may contain more than one column. Therefore, one primary key does not mean one primary-key column.

Question 12

In a relational database model, NULL values can be used for all but which one of the following?

  • A. To allow duplicate tuples in the table by filling the primary key column(s) with NULL.

  • B. To avoid confusion with actual legitimate data values like 0 (zero) for integer columns and '' (the empty string) for string columns.

  • C. To leave columns in a tuple marked as "unknown" when the actual value is unknown.

  • D. To fill a column in a tuple when that column does not really "exist" for that particular tuple.

Answer: A. To allow duplicate tuples in the table by filling the primary key column(s) with NULL.

A primary key must identify each row uniquely and cannot contain NULL, so option A is invalid. The other choices use NULL for unknown or not-applicable data. NULL remains distinct from concrete values such as 0 or an empty string.

Four checks that solve most key MCQs

Check

What it decides

Example

Uniqueness

Superkey test

{EnrollmentNo, Name} identifies a row

Minimality

Candidate-key test

{EnrollmentNo} stays unique after Name is removed

Selection

Primary-key choice

{EnrollmentNo} is selected from the candidate keys

Entity integrity

NULL rule

Primary-key attributes cannot be NULL

For closure questions such as Question 5, identify mandatory attributes (E,H), close plausible sets (AEH, BEH, DEH), then remove one attribute at a time. For counting, use 2^(n-k) only when the stated k-attribute candidate key is the sole candidate key. If candidate-key families overlap, use inclusion-exclusion as in Question 10. Normalization leans on the same candidate-key machinery, so the solved DBMS normalization MCQs are the natural next stop.

Short version and next step

Superkey means unique, candidate key means unique plus minimal, and primary key means the selected candidate key. Redo Questions 5, 7, and 10 without viewing the solutions because they test closure, minimality, and counting. If you need structured full-subject study, use GATE Guidance by Sanchit Sir. For timed practice, use the GATE Test Series. To compare the wider preparation catalogue, browse the GATE category.