sql - How would you design a table to keep track of users' likes and dislikes in mysql -
I want to get my thoughts about preparing a table to store user's likes and dislikes so that people One user can check like / dislike history Suppose I have a list of thousands of products, each of them can be liked or disliked. I have a user ID, product in every line
Is this a suitable approach? Or I should use the conset to add it to a table like I have only one table, user_likes, with columns such as: Use a primary key on user_id and product_id (a user should not be able to like and dislike the product) user_like preference
and dislike
user_id product_id Tom Toys May Toys Peter Toed Tom Toys Peter Toys
user_dislike
Table
user_id product_id Tom ToysB Tom Toyoine May Toyov Paul Paula Paul Paula
user_like_dislike
as a record end, for example: user_like_dislike
user_id Tom likes to like toy, toy toyab, toy mayy toy toynow paul toy, toy peter puppy, toy
user_likes (user_id, product_id, like_type)
Comments
Post a Comment