basic 'global' ledger view.
activate foreign keys for sqlite.
remove 'print' of result.
move foreign key open to a separate file.