
Data Structure
Networking
RDBMS
Operating System
Java
MS Excel
iOS
HTML
CSS
Android
Python
C Programming
C++
C#
MongoDB
MySQL
Javascript
PHP
- Selected Reading
- UPSC IAS Exams Notes
- Developer's Best Practices
- Questions and Answers
- Effective Resume Writing
- HR Interview Questions
- Computer Glossary
- Who is Who
Difference Between Commit and Rollback in SQL
In this post, we will understand the difference between COMMIT and ROLLBACK in SQL.
COMMIT
It validates the modifications that are made by the current transaction.
Once the COMMIT statement has been executed, the transaction can’t be rolled back using ROLLBACK.
It occurs when the transaction is successfully executed.
Syntax
COMMIT;
ROLLBACK
It removes the modifications that were made by the current transaction.
Once ROLLBACK is executed, the database would reach its previous state.
This is the state where the first statement of the transaction would be in execution.
ROLLBACK happens when the transaction is aborted in between its execution.
Syntax
ROLLBACK;
Advertisements