COMMIT is a Transaction Control Language (TCL) command that permanently saves all successful changes made during the current transaction. After a COMMIT, the changes become permanent and cannot be rolled back.
After verifying that every database operation has completed successfully, COMMIT ensures that the changes are permanently stored.
After successfully transferring money between two accounts, the transaction is committed so both account balances are permanently updated.
BEGIN TRANSACTION;
UPDATE Employees
SET Salary = Salary + 5000
WHERE Department = 'IT';
COMMIT;
COMMIT is used in banking systems, payroll processing, order management, inventory updates, healthcare systems, and financial applications.
- Permanently saves transaction changes.
- Used after successful operations.
- Cannot be undone after execution.
- Completes the transaction.
- Ensures data consistency.
- Works with BEGIN TRANSACTION.
- Usually paired with ROLLBACK.
What does COMMIT do?
COMMIT permanently saves all changes made during the current transaction.
Can COMMIT be rolled back?
No. Once COMMIT is executed, the changes become permanent.