Last Updated :
30 Nov, 2018
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.
A C
-----
4 6
5 6
6 5
7 4
9 4
11 7
8 6
The set of all tuples that must be additionally deleted to preserve referential integrity when the tuple (4,6) is deleted is:
(A) (5,6), (6,5) and (8,6)
(B) (5,6) and (8,6)
(C) (7,4) and (9,4)
(D) (7,4), (9,4) and (11,7)
Answer: (D)
Explanation: When (4,6) is deleted. Since C is a foreign key referring A with delete on cascade, all entries with value 4 in C must be deleted. So (7, 4) and (9, 4) are deleted. As a result of this 7 and 9 are deleted from A which causes (11, 7) to be deleted.
So, option (D) is correct.
Quiz of this Question
Share your thoughts in the comments
Please Login to comment...