SQL - ROLLBACK COMMAND (TCL)
Definition
The ROLLBACK command is a Transaction Control Language (TCL) command used to undo or cancel all changes made during the current transaction before they are permanently saved. It restores the database to its previous state before the transaction began.
Syntax
ROLLBACK;
Steps to Use ROLLBACK Command
Step 1: Launch MySQLYog
Open MySQLYog and connect to the MySQL server.
Step 2: Select the Database
Choose the database where the transaction will be performed.
USE college_db;
Step 3: Start a Transaction
Begin a new transaction.
START TRANSACTION;
Step 4: Perform Database Operations
Insert, update, or delete records as required.
UPDATE student
SET city = 'Mumbai'
WHERE id = 1;
Step 5: Execute the ROLLBACK Command
Undo all changes made during the current transaction.
ROLLBACK;
Step 6: Verify the Records
Display the records to check whether the changes have been reverted.
SELECT * FROM student;
Step 7: Confirm the Result
Verify that the original data has been restored successfully.
On this page of the site you can watch the video online SQL ROLLBACK Command Explained | Transaction Control Language (TCL) Tutorial with a duration of hours minute second in good quality, which was uploaded by the user Fratello Innotech 30 March 2026, share the link with friends and acquaintances, this video has already been watched 5 times on youtube and it was liked by 1 viewers. Enjoy your viewing!