📞 0339-0387701 (WhatsApp) Contact

« Back to Database & Data Handling (NCCIA)

Can a UNIQUE key be used as a foreign key reference in another table?

A. Yes, a foreign key can reference a UNIQUE key that is also NOT NULL ✅
B. Yes, even if it contains NULL
C. No, unique keys cannot be indexed
D. No, only primary keys can be referenced

Correct Answer: A. Yes, a foreign key can reference a UNIQUE key that is also NOT NULL

Explanation

A referenced key must uniquely identify the parent row, so a UNIQUE NOT NULL column is a valid target.