我想知道您如何爲投票產品評論建模。如果你已經做了任何網上購物,你可能已經注意到,許多產品評論有一個"x people out of x found this review helpful."
產品評論投票如何在數據庫中建模?
假設許多客戶將審查許多產品,許多客戶將對許多評論投票,是最好有一個表總投票和有幫助的話列,這樣的:
customerReviews(id, customerId, productId, reviewText, totalVotes, helpfulVotes)
還是有兩個表,分別在第二存儲票,因爲這樣的:
customerReviews(id, customerId, productId, reviewText)
reviewVotes(id, reviewId, customerId, helpfull) (helpfull would be a 0,1 value)
你的想法是值得讚賞的。這裏的另一個假設是投票客戶必須是會員。