D
D
djienbaev972019-02-04 11:09:27
Yii
djienbaev97, 2019-02-04 11:09:27

How to create a database for a star rating?

I have tables: carton, movie, anime each has movies. I need to put a rating for each film and also determine the average rating of one film, how will the structure of this star rating be?? how to connect them? help on database structure, i used krajee-star rating

Answer the question

In order to leave comments, you need to log in

1 answer(s)
M
Maxim Timofeev, 2019-02-04
@djienbaev97

Or store the rating value and the number of voters for each film in the rating column and calculate the first one and increment the second
film: id | name | type | rating | vote_num
or have a separate table where to store all the votes and sum up
film: id | name | type
vote: id | user_id | film_id | rating

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question