What is the use of CASCADE CONSTRAINTS?

Answer Posted / nitesh

It is mainly used in referential integrity constraints.

When you use primary key/candidate key of one relation(say,
r1) as foreign key in other relation(say, r2), you want
changes made to primary key/candidate key of r1 must reflect
in foreign key of r2. And this can be achieved by CASCADE
constraint.
eg. consider two relations account, branch(with primary key
branch_name)

create table account(.....
foreign key branch_name references branch
on delete cascade
on update cascade
..........)

Is This Answer Correct ?    0 Yes 0 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

Explain error and transaction handling in sql server?

594


What are commit and rollback in sql?

658


What is extent? Types of extents?

688


What do you understand by the denormalisation?

637


What is database replication? What are the different types of replication you can set up in sql server?

591






Why is sql server log file full?

643


Describe in brief sql server monitoring ways.

664


What is the security principal at the server level that represents your session?

638


How to connect Azure federated root database and apply federation in entity framework?

97


in the physical file layout, where should the transaction log be stored in relation to the data file?

625


What is sql server profiler trace data file?

693


Why would you call update statistics?

680


What is the difference between primary key and unique constraints?

591


How many types of triggers in sql server?

612


Explain four layers of abstraction microsoft architectured?

132