Ask Question

What is a foreign key and how does it provide referential integrity?

+1
Answers (1)
  1. 26 June, 22:58
    0
    By definition a foreign key of table A is a primary key of another table B, thereby establishing a link between them.

    To provide referential integrity you can use these referential actions:

    Cascade: If rows in table B are deleted, the matching foreign key columns in table A are deleted. Set Null: If rows in table B are deleted, the matching foreign key columns in table A are set to null. Set Default: If rows in table B are deleted, the matching foreign key columns in table A are set with the default value of the column. Restrict: A value in table B cannot be deleted or updated while as it is referred to by a foreign key in table A.
Know the Answer?
Not Sure About the Answer?
Find an answer to your question 👍 “What is a foreign key and how does it provide referential integrity? ...” in 📗 Computers & Technology if the answers seem to be not correct or there’s no answer. Try a smart search to find answers to similar questions.
Search for Other Answers