I'm trying to rate Types of Fruit by the best possible rating given by users.
I have a Fruit table called Ratings just for submitting ratings with the following Information
Fruit_id int
From_ID int
Rating int
now I'm trying to run a SQL command like the following
select From_ID, AVG(Rating) AS Rating FROM Ratings Group BY `Fruit_ID` ORDER by Rating DESC
This works however, if i get 1 user who rates a fruit an apple a 5, and then 1000 users who rate an orange a 4 the apple is suddenly considered better.
How can i take number of votes into account, to ensure that the most voted along with best is first.