SELECT
c.name AS `Product Category`,
p.name AS `Product Name`,
COUNT(t.id) AS `Tickets count`
FROM hb_products p
JOIN hb_categories c ON (c.id=p.category_id)
JOIN hb_accounts a ON (a.product_id=p.id)
JOIN hb_tickets t ON (t.client_id=a.client_id)
WHERE
    t.date >= :date_bottom
    AND t.date <= :date_top
GROUP BY p.id
