Skip to content

Latest commit

 

History

History
31 lines (20 loc) · 848 Bytes

TCL.md

File metadata and controls

31 lines (20 loc) · 848 Bytes

TCL - Transaction Control Language

TCL commands can only used with DML commands like INSERT, UPDATE and DELETE only.

These operations are auto commited in the database that's why they cannot be used while creating tables or dropping them.

COMMIT ROLLBACK SAVEPOINT

COMMIT

Save all the transactions to the database.

DELETE FROM Customers
WHERE Age=25;
COMMIT;

ROLLBACK

Undo transactions that have not already been saved to the database.

DELETE FROM Customers
WHERE Age=25;
ROLLBACK;

SAVEPOINT

Roll the transaction back to certain point without rolling back the entire transaction.