简体   繁体   English

如何在SQL中实现有效的审阅功能?

[英]How to implement an efficient review function in SQL?

I'm setting up a database for a website I want to create. 我正在为要创建的网站设置数据库。 I've learned much about SQL in my school, but I've encountered a problem when creating the ERD for my project. 我在学校里学到了很多关于SQL的知识,但是在为我的项目创建ERD时遇到了一个问题。 I want to implement a review function on my website where products can be reviewed by others. 我想在我的网站上实施评论功能,以便其他人可以对产品进行评论。 Now to my problem: How do I implement reviews in my database? 现在是我的问题:如何在数据库中实施评论? I've thought about 我考虑过

reviewID | reviewID | personthatgetsreviewedID | 获得审阅ID的人| personthatreviewedID | 已审核的人ID | reviewtext 评论文本

Is it legit to do a giant review table or should I split it up somehow? 做一个巨大的审查表是合法的还是应该以某种方式将其拆分?

It would be great if you would explain your purpose a bit more clearly. 如果您能更清楚地说明您的目的,那将是很棒的。 However, I think, a single review table would be adequate if managed properly. 但是,我认为,如果管理得当,单个审核表就足够了。 And, I think it would be great to add one more column such as "publishStatus" to filter the review or grant control to admin panels to filter and publish the reviews. 而且,我认为最好再添加一列,例如“ publishStatus”来过滤评论,或者将控制权授予管理面板以过滤和发布评论。 However, this is optional, it depends upon the requirements and your priority. 但是,这是可选的,取决于要求和您的优先级。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM