Communiquez avec les autres et partagez vos connaissances professionnelles

Inscrivez-vous ou connectez-vous pour rejoindre votre communauté professionnelle.

Suivre

What does "cascade" do in dbms?

user-image
Question ajoutée par saraswathi reddy
Date de publication: 2016/07/24
SUBHAM MONDAL MONDAL
par SUBHAM MONDAL MONDAL , WebTek Labs Pvt. Ltd

ON DELETE CASCADE is an optional clause in a foreign key declaration.

It is a foreign key integrity.It is of two type.cascade update and cascade delete.It stated that any time we can change/delete the value of a field of the primary key column and matching value in another column of another related table will be changed/deleted. Integrity constraints will be maintained.  

Vishnuvardhinii S
par Vishnuvardhinii S , Project Engineer , WiproTechnologies

A foreign key with cascade delete means that if a record in the parent table is deleted, then the corresponding records in the child table will automatically be deleted.

REVATHY VENUGOPAL
par REVATHY VENUGOPAL , Graduate Teaching Assistant , Govt. Engineering College

In SQL, cascade delete means if one of the parent record is deleted, then all the corresponding child record will be deleted automatically. In DBMS, there is also an operation called cascading roll back. That is, if a transaction T1 fails, then all other transactions depending on T1 must be roll backed. This is also a cascading effect.  

Gayasuddin Mohammed
par Gayasuddin Mohammed , Advocate , Practicing Law before High Court at Hyderabad

It looks for master-child relationship constraint. so if you want to delete master without deleting the child data, it throws an error as exception. My 2 cents. Thanks.

More Questions Like This