Julia
PRO
2 months ago
Juliacountry asked

Are changes not saved if you don’t use a TCL clause?

Abhay Jajodia
Expert
last month
Abhay Jajodia answered

Hi Julia,

Yes, that’s correct — if you don’t use a TCL command like COMMIT, your changes may not be saved permanently.

When you run SQL statements like INSERT, UPDATE, or DELETE, the changes happen in a temporary state called a transaction. They're not actually saved to the database until you explicitly commit them:

COMMIT;

If you don’t run COMMIT, and you close the connection or something goes wrong, those changes can be rolled back — meaning they’re lost.

You can also use:

  • ROLLBACK to undo changes

  • SAVEPOINT to mark specific points you might roll back to

So yes — using TCL commands like COMMIT is what finalizes your changes.

If you have more questions, I am here to help.

SQL
This question was asked as part of the Learn SQL Basics course.