Explain transaction management with commit,savepoint,rollback commands.
In : BSc IT Subject : Advanced Database Management SystemTransaction 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
2. COMMIT
Saves all changes made during the transaction permanently in the database.
3. ROLLBACK
Undoes all changes made during the transaction. It reverts the database to the last committed state .
4. SAVEPOINT
Sets a point inside a transaction that you can roll back to, without rolling back the whole transaction.