easy · ~8 min
The storefront team wants a per-product summary of customer reviews from reviews. Reviewers may leave text feedback without selecting a star score, in which case rating is NULL.
reviews
rating
NULL
product_id
avg_rating
rated_count
missing_count
Input contract: review_id is unique and non-null in reviews; product_id is non-null; rating is a nullable integer (1 to 5 when present). A product can have all rated reviews, a mix of rated and unrated reviews, or only unrated reviews.
review_id