Skip to main contentSkip to solution

NameAgeGenderUID
Anil22M001
Atul24M002
Ankita21F003
Ajit22M004

For the given table, which attributes can be the primary keys?

(A) Name

(B) Age

(C) UID

(D) Gender

Solution

✅ Correct Option: 1

A primary key must have a unique, non-null value in every row. In this table, Name (Anil, Atul, Ankita, Ajit) and UID (001, 002, 003, 004) are both unique, so either can be the primary key.


Age: the value 22 appears twice (Anil and Ajit), so it cannot identify a row uniquely.

Gender: M appears three times, so it cannot identify a row uniquely.

In real databases, UID is the safer choice because two people can share a name, but only the data in the given table matters here.

Keyboard Shortcuts

  • Left arrow: Previous question
  • Right arrow: Next question
  • S key: Jump to solution
  • Q key: Jump to question