Balance |
select balance
from account
where account_id = ACCOUNT_ID;
|
Deposit |
update account
set balance = balance + AMOUNT
where account_id = ACCOUNT_ID;
|
Withdrawal |
update account
set balance = balance - AMOUNT
where account_id = ACCOUNT_ID;
|
Transfer |
update account
set balance = balance + AMOUNT
where account_id = SOURCE_ACCOUNT_ID;
update account
set balance = balance - AMOUNT
where account_id = TARGET_ACCOUNT_ID;
|
Audit |
select sum(balance)
from account;
|