Home / Questions / Can a relation have more than one foreign key? Explain with the help of an example.
Explanatory Question

Can a relation have more than one foreign key? Explain with the help of an example.

👁 3,517 Views
📘 Detailed Answer
🕒 Easy to Read
Read the answer carefully and go through the related questions on the right side to improve your understanding of this topic.

Answer with Explanation

Yes, a relation can have more than one foreign keys and each foreign key can refer to a different relation. For example, consider REVIEW relation that includes the details of ratings given by the reviewer to a particular book. Here, books and reviewers (or authors) must be associated with book and author that are already in the BOOK and AUTHOR relations respectively. In this case, two foreign keys R_ID and ISBN will be defined on the REVIEW relation that will be related to the primary keys of the AUTHOR and BOOK relation respectively (see Figure below).