Integrity Constraints · Databases
2 questions · asked in 2 of 27 years (2000–2026)
MCQ 1 · NAT 11-mark 2
2000Questions per year2026
Questions 1–2 of 2
Consider the following tables T1 and T2.
In table T1, P is the primary key and Q is the foreign key referencing R in table T2 with ondelete cascade and on-update cascade. In table T2, R is the primary key and S is the foreign key referencing P in table T1 on-delete set NULL and on-update cascade. In order to delete record (3,8) from table T1, the number of additional records that need to be deleted from table T1 is _____.
In table T1, P is the primary key and Q is the foreign key referencing R in table T2 with ondelete cascade and on-update cascade. In table T2, R is the primary key and S is the foreign key referencing P in table T1 on-delete set NULL and on-update cascade. In order to delete record (3,8) from table T1, the number of additional records that need to be deleted from table T1 is _____.
Answer: 0
We delete the record (3, 8) from T1. In T2, S is a foreign key on T1.P with ON DELETE SET NULL. So the T2 row (8, 3) only has its S changed to NULL. No row of T2 is deleted, so nothing cascades back to T1.
Answer: 0
Answer: 0
The following table has two attributes A and C where A is the primary key and C is the foreign key referencing A with on-delete cascade.
The set of all tuples that must be additionally deleted to preserve referential integrity when the tuple (2,4) is deleted is:
The set of all tuples that must be additionally deleted to preserve referential integrity when the tuple (2,4) is deleted is:
Answer: (C)
(C)
We delete . is a primary key, so its foreign key rows and must go too.
Now and are deleted, so their foreign key row must go as well.
No foreign key row refers to .
Keep practising
Topics in Databases
ER ModelRelational SchemaRelational AlgebraTuple CalculusSQL
Integrity ConstraintsYou are here
Normal FormFile SystemTransaction