r/DatabaseHelp • • Jun 17 '18
Double-Entry Accounting
I've been reading "Enterprise Model Patterns" to try to understand more about business databases and accounting, but I'm struggling a bit with what a real double-entry accounting database should look like in practice.
I've started a fiddle here: SQLDBM Accounting Test
If I understand the text, Account should be a super-type, with Assets, Liabilities, etc., being sub-types - which to me translates as 1-to-1 relationships.
Once it gets to balances and transactions, though, I'm pretty sure I have the relationships and keys messed up. It seems like it wouldn't be any different than a line item on an order or invoice, but the sequential nature of immutable accounting is throwing me for a loop.
I've been trying to find a good example schema or diagram - they seem to be extraordinarily rare...at this point, I'd be ready to buy another book if it happened to cover accounting databases in detail.
Any help or examples would be appreciated. I feel like if I saw a working model I'd be able to wrap my head around it. Many thanks in advance.
View all comments
1
u/iPlayKeys Jul 26 '18
Just a few notes to add to what others have said...