Finance metrics: formulas and SQL

Margins, liquidity, cash and efficiency ratios. These are standard accounting definitions, but they depend on how your ledger categorises costs, so reconcile to the source of record.