SELECT bl.name location,COUNT(DISTINCT DATE(t.transaction_date)) active_days,COUNT(t.id) transactions,COUNT(t.id)/COUNT(DISTINCT DATE(t.transaction_date)) daily_traffic 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 daily_traffic DESC;