0

I have a database structure like this (tables):

products

id
title

product_ratings

id
product_id
score
ip_address

so imagine we need to sort products by ratings.

ordering by the average rating is not good enough, this means that an article with only one score of 5 would outrank articles with multiple 4 score ratings.

what can I do for this issue?

  • Something like, sort by _number_ or ratings first then, and only by the actual average value second? – CBroe Apr 19 '21 at 11:25
  • 1
    This is not a programming question then, you need to come up with the business logic for calculating product ratings. There are quite a few ways to do it. – Shadow Apr 19 '21 at 11:25

0 Answers0