SELECT t.nom, count(*) AS nb_colis, round(avg(date_reception - date_depot), 2) AS delai
FROM magasin.lots
JOIN magasin.transporteurs t ON (t.transporteur_id = lots.transporteur_id)
WHERE date_depot BETWEEN '2015-01-01' AND '2015-12-31'
GROUP BY t.nom
ORDER BY t.nom ASC
