Jump to content

Can a foreign key reference a unique non-primary key?


proud

Recommended Posts

Hello everyone, I have 2 tables: [books] with the fields (id, title,author,isbn) and another table called [book issue] with the fields (id, borrower_id, borrow_date, book_isbn)..

Now the field (book_isbn) in the [book issue] table references (isbn) in the books table, which is a unique field but not a primary key.

 

My questions:

 

1- Is it correct for a foreign key to reference a unique but non-primary key in another table?

 

2- Is it okay for the foreign key field to have a different name than the field it references in the other table?

 

Your help is indeed appreciated..

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.