Back

Explore Courses Blog Tutorials Interview Questions
0 votes
2 views
in SQL by (2.6k points)

how can we use commit, rollback, and savepoint in MySQL ?

1 Answer

0 votes
by (7.2k points)

savepoint commit rollback in MySQL. It is a very important command to modify the table.

COMMIT command is used to forever save any transaction into the database.

This command restores the database to the last committed state. It is also used with the SAVEPOINT command to skip to a savepoint in an ongoing transaction.

SAVEPOINT command is used to temporarily save a transaction so that you can rollback to that point whenever required.

commit command's syntax,

COMMIT;

rollback command's syntax,

ROLLBACK TO savepoint_name;

savepoint command's syntax,

SAVEPOINT savepoint_name;

Related questions

0 votes
1 answer
asked Dec 27, 2020 in SQL by Appu (6.1k points)
0 votes
1 answer
asked Jul 4, 2019 in SQL by Tech4ever (20.3k points)

Browse Categories

...