What is the use of CASCADE CONSTRAINTS?
Answers were Sorted based on User's Feedback
Answer / naresh
If you specify this option, later when you delete a row in
the parent table, the database server also deletes any rows
associated with that row (foreign keys) in a child table.
The principal advantage to the cascading-deletes feature is
that it allows you to reduce the quantity of SQL statements
you need to perform delete actions.
| Is This Answer Correct ? | 14 Yes | 0 No |
Answer / kunal sain
to drop the constraint from child table when dropping the
constraint from parent table.
| Is This Answer Correct ? | 10 Yes | 1 No |
Answer / 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 |
does physical index sort data
What is a synonym for manipulation?
can you any body tell me the difference between candidate key and primary key
How should i optimize the time for execution of stored procedure having single input and many output from the different tables?
Define model database?
Data table as parameter in sql server?
Write an sql query to find the names of employees start with ‘a’?
How do I find the sql server database version?
List out some of the requirements to set up a sql server failover cluster?
How to write a query with a full outer join in ms sql server?
How to turn on the mssql api module in php?
what are different types of raid configurations? : Sql server database administration
Oracle (3259)
SQL Server (4518)
MS Access (429)
MySQL (1402)
Postgre (483)
Sybase (267)
DB Architecture (141)
DB Administration (291)
DB Development (113)
SQL PLSQL (3330)
MongoDB (502)
IBM Informix (50)
Neo4j (82)
InfluxDB (0)
Apache CouchDB (44)
Firebird (5)
Database Management (1411)
Databases AllOther (288)