SELECT bl.name location,DATE(t.transaction_date) date,COUNT(t.id) transactions,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,DATE(t.transaction_date) ORDER BY date;