ITP

BSc IT - Advanced Database Management System

Explain transaction management with commit,savepoint,rollback commands.

In : BSc IT Subject : Advanced Database Management System

Transaction management in SQL is used to manage data changes in a database where multiple operations are performed as a single unit . This ensures that the database remains consistent, even if an error occurs during the process. 

There are three important commands used in transaction management: 

1. BEGIN / START TRANSACTION

Marks the start of a transaction . All database operations between this and the end are treated as one unit

START TRANSACTION;
 

2. COMMIT

Saves all changes made during the transaction permanently in the database. 

COMMIT;
 

3. ROLLBACK

Undoes all changes made during the transaction. It reverts the database to the last committed state .

ROLLBACK;
 

4. SAVEPOINT

Sets a point inside a transaction that you can roll back to, without rolling back the whole transaction.

SAVEPOINT savepoint_name;
 

About us

A truly open platform where you may ask questions and get answers. We also provide comprehensive and easy-to-understand answers to question papers.  discover...

Site status

Flag Counter

Privacy Policy

Sitemap