...
Database-Management-System
August 29, 2024
Database-Management-System
August 29, 2024
Database-Management-System
August 29, 2024
Database-Management-System
August 29, 2024

Database-Management-System

Question 303

The following table has two attributes X and Z, where X is the primary key and Z
is the foreign key referencing X with on-delete cascade.

The set of all tuples that are additionally deleted to preserve referential integrity
when the tuple (2,4) is deleted are:

A
(3,4) and (6,4)
B
(5,2) and (7,2)
C
(5,2), (7,2) and (9,5)
D
(3,4), (4,3) and (6,4)
Question 303 Explanation: 

The tuple (2,4) is deleted, so all the rows will be deleted in which Z contains value 2. So (5,2), (7,2) will also be deleted.

Now since (5,2) and (7,2) is deleted, so all the rows will be deleted in which Z contains values 5 & 7. So (9,5) will be deleted.

Now since (9,5) is deleted, so all the rows will be deleted in which Z contains 9. But since Z does not contain 9 so here the deletion stops.

Hence the additional deleted rows are (5,2), (7,2), (9,5).
Correct Answer: C
Question 303 Explanation: 

The tuple (2,4) is deleted, so all the rows will be deleted in which Z contains value 2. So (5,2), (7,2) will also be deleted.

Now since (5,2) and (7,2) is deleted, so all the rows will be deleted in which Z contains values 5 & 7. So (9,5) will be deleted.

Now since (9,5) is deleted, so all the rows will be deleted in which Z contains 9. But since Z does not contain 9 so here the deletion stops.

Hence the additional deleted rows are (5,2), (7,2), (9,5).
0 0 votes
Article Rating
Subscribe
Notify of
0 Comments
Inline Feedbacks
View all comments
0
Would love your thoughts, please comment.x
()
x
error: Alert: Content selection is disabled!!