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
Distinct is used to select distinct elements, nothing more, while you want to aggregate and for that you need GROUP BY and aggregation functions (SUM).
GROUP BY
SUM