Rating System Database Structure
Posted
by Harsha M V
on Stack Overflow
See other posts from Stack Overflow
or by Harsha M V
Published on 2010-06-01T05:51:41Z
Indexed on
2010/06/01
5:53 UTC
Read the original article
Hit count: 319
I have two entity groups. Restaurants and Users. Restaurants can be rated (1-5) by users. And rating fromeach user should be retrievable.
Resturant(id, name, ..... , total_number_of_votes, total_voting_points ) User (id, name ...... )
Rating (id, restaurant_id, user_id, rating_value)
Do i need to store the avg value so that it need not be calculated every time ? which table is the best place to store avg_rating, total_no_of_votes, total_voting_points ?
© Stack Overflow or respective owner