1
SQLAdvanced#transactions
READ UNCOMMITTED allows dirty reads; READ COMMITTED prevents them; REPEATABLE READ also prevents non-repeatable reads; SERIALIZABLE additionally prevents phantom rows. Higher isolation means more correctness and less concurrency.
SET TRANSACTION ISOLATION LEVEL REPEATABLE READ; BEGIN; SELECT balance FROM accounts WHERE id = 1; -- same value if re-read in this txn COMMIT;