ID: availbl promise debt -------------------------------- Club: 0 +7200 -23450 john: 7200 +0 -7200 # Reflect john paying its bills all at once ... Club: 7200 +0 -23450 john: 0 +0 0 # Charge Club with server hosting provided by alex ... Club: 0 +0 -16250 alex: 7200 +16250 0 # Some updates and deletes that could, unless denied, destroy consistency ... Error: near line 46: paid is set and adjusted automatically according to added Transfer records Error: near line 47: Debt is involved in transfers to revoke at first Error: near line 48: FOREIGN KEY constraint failed # After revoking transactions, you are free to change or delete debts and credits ... Club: 7200 +0 0 alex: 0 +0 0 # But let's rollback that what-if excurse. This is how it currently is ... Club: 0 +0 -16250 alex: 7200 +16250 0 ################################################################### # Now it is your turn: Study the sql code yielding the output above # then enter new members and let them pay the fees. # (PLUS: Let have one discalculia and pay too little or too much.) # Once the club has enough money to pay alex' hosting service, # update (i.e. revoke and reenter) the respective transaction. # Finally issue a bank transfer to alex. Hint: An outgoing transfer # is simply a debt charging alex' own virtual account and without # targetCredit (NULL). PLUS: What happens if the description of # the bank transfer does not contain any or only a wrong IBAN?