Podcast
Questions and Answers
What is the main concept of referential integrity?
What is the main concept of referential integrity?
- It prevents adding records in a table that contain a foreign key, unless there is a corresponding primary key in the reference table. (correct)
- It maintains consistency between primary keys across different tables.
- It ensures that all tables have both primary and foreign keys.
- It allows adding any record in a table that contains a foreign key, regardless of the primary key in the reference table.
Which of the following is NOT a rule of referential integrity?
Which of the following is NOT a rule of referential integrity?
- Do not delete data required by another table.
- Allow duplicate primary keys in the parent table. (correct)
- Do not add incompatible data to a child table.
- Value of foreign key must exist in the primary key it refers to.
What happens if you try to delete a primary key that has related foreign keys?
What happens if you try to delete a primary key that has related foreign keys?
- The deletion is allowed, and all related foreign keys are also deleted.
- The deletion is not allowed, as it would violate referential integrity. (correct)
- The deletion is allowed, but all related foreign keys are set to NULL.
- The deletion is allowed, but a warning is displayed about the related foreign keys.
Which of the following statements is true about foreign keys?
Which of the following statements is true about foreign keys?
What is the purpose of the rule "Do not add incompatible data to a child table"?
What is the purpose of the rule "Do not add incompatible data to a child table"?