Referential Integrity (OCR A-Level Computer Science): Quizzes
📚Quizzes
Practise the questions
12 questions from this quiz
ShowHide
Practise the questions
12 questions from this quiz
What does referential integrity ensure in relational databases?
What does referential integrity ensure in relational databases?
Relationships between tables remain consistent
What must a foreign key value in a table either be?
What must a foreign key value in a table either be?
Null or match a primary key value
What are orphaned records?
What are orphaned records?
Records with invalid references
How is referential integrity typically enforced?
How is referential integrity typically enforced?
Through foreign key constraints
What happens when you try to add a foreign key value that doesn't match an existing primary key?
What happens when you try to add a foreign key value that doesn't match an existing primary key?
The database blocks the insertion
What does the database prevent when a primary key record is referenced by foreign keys?
What does the database prevent when a primary key record is referenced by foreign keys?
Deletion unless cascade rule specified
In the Students/Enrollments example, can you add an enrollment with Student_ID 103?
In the Students/Enrollments example, can you add an enrollment with Student_ID 103?
No, 103 doesn't exist in Students table
What does a cascading delete rule allow?
What does a cascading delete rule allow?
Automatic deletion of related records
How does referential integrity help prevent orphaned records?
How does referential integrity help prevent orphaned records?
Ensures every record has a valid reference
What does referential integrity maintain across related tables?
What does referential integrity maintain across related tables?
Data consistency
What is a common mistake about what referential integrity enforces?
What is a common mistake about what referential integrity enforces?
Assuming it enforces data accuracy
What can happen if foreign key constraints are ignored?
What can happen if foreign key constraints are ignored?
Orphaned records may occur
