Give an example scenario to demonstrate set to null rule for

Give an example scenario to demonstrate set to null rule for deletion operation in referential integrity. Explain your story and draw your tables.This question is based on database.

Solution

Suppose 2 schemas are there

A(x, y, z), primary key : a
B(p, q, r), foreign key : p referencing \'a\' of table A


So, If we wish to delete any row(entry) of table A. Suppose we wish to delete the row (1, 2, 3),
we should check every occurance of p = 1 in the table B.

If its present anywhere, we should set it to NULL, because if we don\'t, it will be the violation of foreign key constraint

Give an example scenario to demonstrate set to null rule for deletion operation in referential integrity. Explain your story and draw your tables.This question

Get Help Now

Submit a Take Down Notice

Tutor
Tutor: Dr Jack
Most rated tutor on our site