民意调查数据库架构

发布于 2024-09-12 22:44:57 字数 333 浏览 3 评论 0原文

我想创建一个民意调查系统,可以在我的网站上提供很多答案,但我在想最好的方法是什么。我不太专业。

我正在考虑这个模式:

polls
-------------------------------------
id | question | start_time | end_time

poll_answers
---------------------
id | poll_id | answer

poll_votes
--------------------------
id | poll_answer | user_id 

你觉得怎么样?

谢谢

I wanna create a poll system with possibilty to have many answers on my website but im thinking whats the best way. Im not so pro.

Im thinking this schema:

polls
-------------------------------------
id | question | start_time | end_time

poll_answers
---------------------
id | poll_id | answer

poll_votes
--------------------------
id | poll_answer | user_id 

What do you think?

Thanks

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

一场春暖 2024-09-19 22:44:57

看起来不错。但是,如果您希望将来能够进行多问题民意调查,您可以考虑使用额外的问题表。

Looks good. However you may consider an additional question table if you might want the possibility to have multi-question polls in the future.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文