Last answered:

13 May 2024

Posted on:

13 May 2024

0

difference between save and commit

I am actually unable to comprehend the difference between saving and comiting in sql. What would happen if I save instead of comiting it. Thanks.

Looking foward to your reply.

1 answers ( 0 marked as helpful)
Instructor
Posted on:

13 May 2024

0

Hi Muhammad!
Thanks for reaching out.


In MySQL, when you're making changes within a transaction, you're likely using commands like "UPDATE" or "DELETE" to modify data in the database. These commands allow you to specify the changes you want to make to the data. However, it's important to remember that these changes aren't permanently applied until you use the "COMMIT" command to finalize the transaction. So, while you may refer to making changes as "saving" within the transaction, the actual commands you're using are "UPDATE" and "DELETE". To ensure these changes are permanently stored in the database, don't forget to commit the transaction using the "COMMIT" command.


Hope this helps.
Best,
Tsvetelin

Submit an answer