A foreign key constraint allows certain attributes in one relation to refer to attributes in another relation. The relation on which foreign key constraint is defined contains the partial information. Its detailed information can be searched from another relation with a matching entry. A foreign key constraint not only controls the data that can be stored in the referencing relation but also controls the changes made to the referenced relation. For example, if the tuple for a publisher is deleted from the PUBLISHER relation, and the publisher's ID is used in the BOOK relation, the deleted publisher's ID becomes orphaned in the BOOK relation. This situation can be prevented by a foreign key constraint.
Foreign key constraint enforces referential integrity by ensuring that an attribute in a relation S whose value in each tuple either matches with the values of the primary key in another relation R or is null. For example, the foreign key attribute R_ID in the REVIEW relation must have either the same values as that of the primary key A_ID of the AUTHOR relation or must be null.
First read the answer fully, then try to explain it in your own words. After that, open a few related questions and compare the concepts. This method helps you remember the topic for a longer time and improves exam preparation.