需要矩阵问题表设计的反馈
在调查中,有一类问题叫做矩阵,它是这样的:
| Is Friendly | Weather | Comments
===========================================
Sydney | Y | 5 | 'bla'
-------------------------------------------
Singapore | Y | 10 | 'test'
-------------------------------------------
Jakarta | N | 0 | 'test2
-------------------------------------------
尝试在设计问答的SQL表方面获得反馈。我可以有一个设计,你只能有 3 个标签集(友好、天气、评论),或者可能扩展到 10 个来保存,这意味着我有 10 列。
您对这种方法有何看法,我知道这不是关系数据库,但至少从查询的角度来看,可以得出答案。
你的想法?
In the survey, there is a type of question called Matrix which it's like this:
| Is Friendly | Weather | Comments
===========================================
Sydney | Y | 5 | 'bla'
-------------------------------------------
Singapore | Y | 10 | 'test'
-------------------------------------------
Jakarta | N | 0 | 'test2
-------------------------------------------
Try to get a feedback in term of designing SQL table for question and answer. I could have a design that you can only have 3 label sets (Is Friendly, Weather, Comment) or maybe extended to 10 to be save which means I have 10 columns.
What do you think about this approach, I know this is not relation database in such but at least from query point of view for answer to pull out.
Your thought?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
在 Sql Server 中,您可以使用 PIVOT。
这将允许您以不同的方式设计表格。
然后,您将拥有一个包含
的表这基本上将为您提供“动态”功能列。
In Sql Server you can make use of PIVOT.
This will allow you to design the table differently.
You would then have a table with columns
This will basically give you the functionality to have "dynamic" columns.