Create a trigger xxxxxxxx after inserting each line on the loan form.
begin
Update account book table set account book quantity = account book quantity-1 where account book id=:new. Borrowing books list book id
end
Like this, the rest will be debugged by yourself.