SELECT bl.name location,COUNT(t.id) shipments,SUM(t.shipping_charges) shipping_cost,AVG(t.shipping_charges) avg_shipping_cost FROM business_locations bl JOIN transactions t ON bl.id=t.location_id WHERE t.type="sell" AND t.shipping_charges>0 GROUP BY bl.id,bl.name ORDER BY shipping_cost DESC;