SELECT bl.name location,COUNT(t.id) transactions,AVG(t.final_total) avg_transaction,COUNT(DISTINCT t.contact_id) unique_customers 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;