SELECT bl.state,bl.city,COUNT(DISTINCT c.id) customers,COUNT(t.id) transactions,AVG(t.final_total) avg_transaction FROM business_locations bl JOIN transactions t ON bl.id=t.location_id JOIN contacts c ON t.contact_id=c.id WHERE t.type="sell" GROUP BY bl.state,bl.city ORDER BY transactions DESC;