sqlbeginner

Transaction - Technique 7

Manage database transactions

sql
BEGIN;

UPDATE wallet SET balance = balance - 50 WHERE user_id = 1;
UPDATE wallet SET balance = balance + 50 WHERE user_id = 2;

COMMIT;

Use Cases

  • database operations
  • data management

Tags

Related Snippets

Similar patterns you can reuse in the same workflow.