Database-Management-System
August 29, 2024Database-Management-System
August 29, 2024Database-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:
(3,4) and (6,4) | |
(5,2) and (7,2) | |
(5,2), (7,2) and (9,5) | |
(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).
Subscribe
Login
0 Comments