SELECT
i.name AS item_name,
MONTH(fd.date) AS month,
SUM(fd.quantity) AS total_distributed
FROM Food_Distributions fd
JOIN Inventory i ON fd.supply_id = i.supply_id
WHERE fd.date >= DATE_SUB(CURDATE(),INTERVAL 1 YEAR)
GROUP BY i.name, MONTH(fd.date)
ORDER BY i.name, month
| Item | Month | Total Distributed |
|---|---|---|
| Canned Beans | 4 | 10 |
| Pasta | 4 | 5 |
| Peanut Butter | 4 | 2 |
| Rice | 4 | 8 |