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