Thursday, May 4, 2023

TCL commands

TCL COMMANDS:

1. COMMIT:

Commits a Transaction. The COMMIT command saves all the transactions to the database since the last COMMIT or ROLLBACK command.

Syntax: COMMIT;

Example:

DELETE FROM Student WHERE AGE = 21; COMMIT:

2. ROLLBACK:

If any error occurs with any of the SQL-grouped statements, all changes need to be aborted. The process of reversing changes is called rollback

Syntax: ROLLBACK;

Example:

DELETE FROM Student WHERE AGE = 21; ROLLBACK;