Sales metrics: formulas and SQL

Metrics for pipeline, deals and quota. Most sales numbers go wrong at the definition: which deals count as closed, which date counts, and whether open deals are in the denominator.