简体   繁体   English

存储此类数据的最佳方法是什么?

[英]What is the best way to store this type of data?

I have a form that is being filled by customers, the form is very long and contains approximately 30-40 fields. 我有一个正在由客户填写的表格,该表格很长,包含大约30-40个字段。

One part of the form is particularly complex to store as it is a matrix of checkboxes that the user needs to select. 表单的一部分特别复杂,因为它是用户需要选择的复选框矩阵。

Example: 例:

> Fir Item | A Checkbox | B Checkbox | C Checkbox
> Sec Item | A Checkbox | B Checkbox | C Checkbox
> Thi Item | A Checkbox | B Checkbox | C Checkbox
> Fou Item | A Checkbox | B Checkbox | C Checkbox
> Fif Item | A Checkbox | B Checkbox | C Checkbox

What is the most efficient way of storing this data? 存储此数据的最有效方法是什么?

Thanks, 谢谢,

If all items contains same options, this should be your first choice: 如果所有项目都包含相同的选项,那么这应该是您的首选:

[Customer] (Id, ....)
[Item]     (Id, Name)
[Option]   (Id, Name)
[CustomerResponse] (CustomerId, ItemId, OptionId)

If options "never" changes and you don't want to keep them in a separate table: 如果选项“从不”更改,并且您不想将它们保留在单独的表中:

[Customer] (Id, ....)
[Item]     (Id, Name)
[CustomerResponse] (CustomerId, ItemId, OptionA bit, OptionB bit, OptionC bit)

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

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