Accounting queries - bogus pull requeest (DON'T MERGE)

Just so you know this stuff exists; accounting-related SQL queries.

Extensive descriptions are in comments in the files themselves.