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