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

What are the two authentication modes in sql server?

600


What is the difference in accessing db between sql server vs sql azure?

157


What is isnull() operator?

566


What is normalization and denormalization in sql server?

535


Explain some stored procedure creating best practices or guidelines?

520






how would you write a sql query to compute a frequency table of a certain attribute involving two joins? What changes would you need to make if you want to order by or group by some attribute? What would you do to account for nulls?

1099


What is difference between Datepart() and Datename() in SqlServer?

718


How to receive output values from stored procedures?

481


What is sql service broker?

586


What is fill factor and pad index?

542


What is 1nf 2nf?

547


What are the advantages of sql stored procedure?

532


What happens when converting big values to numeric data types?

567


Explain what is the use of custom fields in report?

496


How does using a separate hard drive for several database objects improves performance right away?

528