I have the following medleys table that combines colors, fruits and ratings:
medleys
colors
fruits
ratings
[medleys] medley_id | co
This should answer your question:
SELECT color, fruit, sum(rating) as [sum] FROM medleys GROUP BY color, fruit ORDER BY color