用于存储安装数据的DataBase设计 [英] DataBase design for store anketing data

查看:104
本文介绍了用于存储安装数据的DataBase设计的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我的英语不好,所以很抱歉。
我想编写网络应用程序的安装。我的意思是,它必须是一个网站,用户可以给出不同问题的答案。例如,它可以是文本类型的答案,或复选框或查找(组合框)的问题。

my English is not well, so sorry for it. I want to write the web-app for anketing. I mean, that it must be a site, where user may give answers on different questions. For example, it can be question with text type of answer, or checkbox, or lookup (comboBox).

我的问题是在数据库架构。我读了很多关于实体属性值db模式,一个True Lookup Table我也读了。但是这些模式在构建用于数据选择(报告)的sql查询时有问题(用ms sql)。

And my problem is in data base architecture. I read a lot about Entity Attribute Value db pattern, One True Lookup Table I also read. But these patterns has problem (with ms sql) when building a sql-query for data selecting (report).

我希望有人给我一个好的建议,

I hope somebody give me a good suggestion, and tell, what can I do with this proplem.

谢谢!

推荐答案

几乎所有的东西都可以表示为字符串。为什么不在数据库中存储字符串文本类型回答或truefalse或ComboBox值等。然后只需在运行时或在SQL中从数据库转换值,如果写入查询?

Almost everything can be represented as a string. Why not store a string in the database e.g. Text Type Answer or "true" "false" or ComboBox Value etc. Then simply convert the value from the database if necessary at runtime or in SQL if writing a query?

我觉得实体属性值模式意味着更多的实体可以有动态字段添加等,而不是那么多的你在这里提出的问题。

I feel Entity Attribute Value pattern is meant more for Entities which can have dynamic fields added etc, not so much for the problem you've posed here.

如果必要,你可以还向数据库表添加一个附加列,以指定要存储的数据的类型。然后,您可以使用该列来基于您的查询转换语句。

If necessary you could also add an additional column to the database table to specify the "type" of data being stored. You could then use that column to base your query convert statements on etc.

这篇关于用于存储安装数据的DataBase设计的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆