IAE Academy

GATE 2025 DA Q.56: solution and answer

GATE 2025 · DAQ.56 · 2 marks · MSQ

Consider the following two relations, named Customer and Person, in a database:

Person (
    aadhaar CHAR(12) PRIMARY KEY,
    name VARCHAR(32));
Customer (
    name VARCHAR(32),
    email VARCHAR(32) PRIMARY KEY,
    phone CHAR(10),
    aadhaar CHAR(12),
    FOREIGN KEY (aadhaar) REFERENCES Person(aadhaar));

Which of the following statements is/are correct?

  1. (A)

    aadhaar is a candidate key in the Customer relation

  2. (B)

    phone can be NULL in the Customer relation

  3. (C)

    aadhaar is a candidate key in the Person relation

  4. (D)

    aadhaar can be NULL in the Person relation

See the question in the paper

Answer and solution

ANSWER

The correct statements are (B) and (C).

Official answer: B, CSource: Official answer key, GATE 2025 DA (IIT Roorkee)

  1. A candidate key is a minimal set of attributes that uniquely identifies every tuple of a relation. A PRIMARY KEY is always a candidate key, and it is implicitly UNIQUE and NOT NULL.

  2. Person: aadhaar is declared PRIMARY KEY, so its values are unique and never NULL. It is a candidate key of Person, so (C) is correct.

  3. Because aadhaar is the primary key of Person, it can never be NULL there, so (D) is false.

  4. Customer: the primary key is email. The column aadhaar is only a foreign key, and a foreign key carries no uniqueness constraint. Several customers can share one aadhaar value (for example, one person registered with two e-mail addresses), so aadhaar does not identify tuples uniquely. (A) is false.

  5. Customer.phone is declared as CHAR(10) with no NOT NULL and is not part of the primary key. Only primary-key columns are forced to be non-NULL, so phone can be NULL. (B) is correct.

  6. Correct options: (B) and (C).

KEY IDEA

A primary key is a candidate key and is automatically unique and NOT NULL. A foreign key column gives neither uniqueness nor non-nullness, so it is a candidate key only if something else makes it unique.

WATCH OUT FOR

Treating the foreign key Customer.aadhaar as a candidate key because it refers to a primary key. The reference makes values in Customer.aadhaar match values in Person, but it does not stop two customers from sharing a value.

From the GATE 2025 DA paper. Every question of this paper · Download the full paper · All 6 Normal forms questions, with notes

More Normal forms questions