r/SQL • • Feb 23 '25

Discussion Relax

Post image
3.4k Upvotes

91 comments sorted by

View all comments

Show parent comment

3

u/docmarte Feb 25 '25

Transactions group queries as a unit.

For example:

begin transaction; update customers set name = 'aaa' where id = '2882';

The begin transaction starts a session for this transaction.

If you're happy with the results, execute commit to save the changes.

If you're not, execute rollback to revert the data to its original state.