I have the following medleys table that combines colors, fruits and ratings:
medleys
colors
fruits
ratings
[medleys] medley_id | co
SELECT `color`,`fruit`,SUM(`rating`) FROM Medleys GROUP BY `color`,`fruit`
SQL Fiddle Example