0 votes
in Oracle by
Retrieve the top five highest-rated products based on customer reviews from the product_reviews table.

1 Answer

0 votes
by

SELECT product_id, product_name, AVG(review_rating) AS average_rating

FROM product_reviews

GROUP BY product_id, product_name

ORDER BY average_rating DESC

FETCH FIRST 5 ROWS ONLY;

...