📞 0339-0387701 (WhatsApp) Contact

« Back to Database & Data Handling (NCCIA)

If a UNIQUE column is also declared NOT NULL, how does it differ from a PRIMARY KEY?

A. It allows duplicates
B. It cannot be a candidate key
C. It is almost the same, except a table can have many such columns but only one primary key ✅
D. It cannot be indexed

Correct Answer: C. It is almost the same, except a table can have many such columns but only one primary key

Explanation

A UNIQUE NOT NULL column is a candidate key; the only structural difference is that only one candidate can be the primary key.