amount source target (metadata like date ...)
For each account X you get the left and right side with simple SQL queries: select * from T where source=X
select * from T where target=X
All the other mumbo-jumbo about double-entry bookkeeping is implicitly baked in. For example, "The double-entry bookkeeping system ensures that the financial transaction has equal and opposite effects in two different accounts." Of course, each entry subtracts amount from the source and adds it to target.While this representation is easy to implement (see ledger, i suppose), it does not lead to pretty graph pictures.