📞 0339-0387701 (WhatsApp) Contact

« Back to Database & Data Handling (NCCIA)

What is the purpose of a UNIQUE constraint on a Username column?

A. To make usernames numeric
B. To hide usernames from queries
C. To allow duplicate usernames
D. To prevent two users registering the same username ✅

Correct Answer: D. To prevent two users registering the same username

Explanation

Usernames must be distinct for login and identification, so UNIQUE enforces that rule.