Gate2017 ss Q21

0. 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 on delete 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 _____.
Note – Numerical Type question

  • Option : A
  • Explanation :
    As Q refers to R so, deleting 8 from Q won't be an issue, however, S refers P. But as the relationship given is on delete set NULL, 3 will be deleted from T1 and the entry in T2 having 3 in column S will be set to NULL. So, no additional records deleted from table T1
Cancel reply

Your email address will not be published. Required fields are marked *


Cancel reply

Your email address will not be published. Required fields are marked *