调查构建器应用程序的数据库设计 [英] Database design for a survey builder application

查看:94
本文介绍了调查构建器应用程序的数据库设计的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想为下面给出的场景开发一个数据库:

i想要保存调查表的详细信息。

在我的项目中用户可以创建调查表单,可以向其添加问题和选项。我想保存调查的详细信息,即当用户保存调查时所有问题,他们的选项必须与调查标题和描述一起保存。我应该如何创建表,我应该为问题和选项创建单独的表,然后应该使用调查ID作为外键或我应该使用其他方法???这可能是一个愚蠢的问题,但不幸的是我没有得到一个正确的解决方案吗?

解决方案

在很大程度上取决于你,以及软件如何与用户的接口将起作用。



我要做的就是坐下来一堆纸,然后完成用户可以做的各种事情手动,记录所有数据,以及它在用户参与过程中如何变化。

然后我会从管理员方面做同样的事情 - 我需要什么报告,什么信息报告是否需要整理等等。

然后查看数据 - 很明显你需要n表,或者你可以用现有表上的一两列替换整个表。

所以设计一组表格,然后再试一次,这次对你如何访问数据非常严格。

有什么困难?什么容易?额外的桌子会有帮助吗?或者桌子没用?



重复几次,你应该想出一个基本设计。


检查本网站供参考

http://www.databaseanswers.org/data_models/ [ ^ ]

开始数据建模教程 [ ^ ]

i want to develop a database for the scenario given below:
i want to save details of a survey form.
in my project a user can create a survey form can add questions and options to it. i want to save details of survey i.e when user saves a survey all the questions and their options must be saved with the survey title and description. how i should create tables either i should create separate tables for questions and options and then should use survey id as foreign key or i should use some other approach??? this may be a stupid question but unfortunately i am not getting a right solution for this problem??

解决方案

To a large extent that depends on you, and how the software that interfaces with the user is going to work.

What I would do is sit down with a pile of paper, and go through all the various things a user can do manually, making a note of all data, and how it changes through the course of a users involvement.
Then I'd do the same thing from the admin side - what reports do I need, what infor does the report need to collate from and so forth.
Then look at the data - it should be obvious that you need "n" tables or that you can replace a whole table with an additional column or two on an existing table.
So design a set of tables, and try again, this time being rigorous about how you access the data.
What's difficult? What's easy? Would an extra table help? Or is a table useless?

Repeat that a few times, and you should come up with a basic design.


Check this site for reference
http://www.databaseanswers.org/data_models/[^]
Tutorial on Beginning Data Modelling[^]


这篇关于调查构建器应用程序的数据库设计的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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