top button
Flag Notify
    Connect to us
      Site Registration

Site Registration

SQL: What is the use of CASCADE CONSTRAINTS?

+2 votes
523 views
SQL: What is the use of CASCADE CONSTRAINTS?
posted Mar 25, 2014 by Deepak Chitragar

Share this question
Facebook Share Button Twitter Share Button LinkedIn Share Button

1 Answer

+1 vote

Cascading is used for maintaining referential integrity rules, which says that foreign key attributes values should be either subset of primary key values or null.

With cascading when parent is deleted, Child could be deleted/set null/set default according to cascade type. All this is for maintain integrity.

We won't be able to delete a record from the parent table if there is some corresponding record exists in the child table.

For this we are using Cascading Constraint. With help of cascading constraint we can delete a record from the parent table as well as from all the corresponding records from the child table. Even we can set some null values.

answer Mar 25, 2014 by Manish Tiwari
...