Last answered:

17 Apr 2024

Posted on:

13 Apr 2024

0

Resolved: Foreign Key referencing

Can a Foreign Key reference to a Unique Key?

2 answers ( 1 marked as helpful)
Instructor
Posted on:

15 Apr 2024

1

Hi Agrim!
Thanks for reaching out.


Yes, a foreign key can reference a unique key in a database. This is because a unique key, like a primary key, ensures that all values in the column are unique, which is a necessary condition for a column to be referenced by a foreign key. The essential requirement for a foreign key is that the column it references must have unique values to maintain referential integrity.


Hope this helps.
Best,
Tsvetelin

Posted on:

17 Apr 2024

0

Thank you for the reply!

Submit an answer