Skip to main content

Practice ยท 1 of 2

Atomic Transfer

Implement transfer(conn, src, dst, amount) moving money between rows of accounts(id INTEGER PRIMARY KEY, balance INTEGER). Raise ValueError if either account is missing or src has insufficient funds (and roll back). On success, commit.

Difficulty: intermediate

Back to lesson: Practice: Transaction Drills