Name Age Gender UID Anil 22 M 001 Atul 24 M 002 Ankita 21 F 003 Ajit 22 M 004
For the given table, which attributes can be the primary keys?
(A) Name
(B) Age
(C) UID
(D) Gender
| Name | Age | Gender | UID |
|---|---|---|---|
| Anil | 22 | M | 001 |
| Atul | 24 | M | 002 |
| Ankita | 21 | F | 003 |
| Ajit | 22 | M | 004 |
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.
Related questions:
2026: 11 May Shift 2
2026: 13 May Shift 2
2025: 21 May Shift 1