Попробуйте выполнить запрос ниже:
SELECT DISTINCT product_id, p.category_id, sum(discount_amount)
FROM product p
INNER JOIN discount d ON p.category_id = d.category_id
GROUP BY product_id;
Вывод:
product_id, category_id, total discount amount
1 65 900
2 66 1200
3 67 600