I'm very new to databse design and I need some help with a calculation that i'm working on

i have 4 tables. customer, product, line item, and category

The line item table is connected to the product, customer tables and the product table is connected to the category table and contains the pricing information

i can get the sum of all the purchases made by a single customer but i am not sure how to get the sum of the purchases in a single category for each customer.

any help on this is greatly appreciated