vendredi 23 août 2019

Keeping rating for multiple tables

Having the db design with more than two tables representing main entities e.g. book, publisher, author I want to find out what will be best approach for user-rating for a given entity.

Is it the best to create one table with no relation to the above tables but only for user table (to show user the rating of a given table record) and indicate the type of related table with varchar?

Or is it better to keep separate rating table for each of the tables.

My idea would be as below but I'm not sure is it the best way to store this kind of data.

***rating table***
ObjectType
ObjectId
UserId
RatingScore

Aucun commentaire:

Enregistrer un commentaire