Sql0:48
2026-07-30_sql-lesson-28-transactions-and-acid-properties-short3
The solution
try:
cur.execute(
"UPDATE accounts SET balance=balance-100 WHERE id='A'")
cur.execute(
"UPDATE accounts SET balance=balance+100 WHERE id='C'")
conn.commit()
except:
conn.rollback()Ready to try it yourself? Solve Sql problems with instant feedback in the practice sandbox.
Practice now →


