MySQL表设计问卷 [英] MySQL Table Design for a Questionnaire

查看:283
本文介绍了MySQL表设计问卷的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我对MySQL很新,并且有一个项目,我需要设计一个数据库,用于存储来自在线问卷的答复。需要从数据中写出报告。有没有人对什么类型的字段使用任何提示?这些问题将有一个是无答案,从非常满意或非常不满意或多选择的4个选项的选择。这主要是我不确定的选择问题,因为我需要能够产生报告来显示满意客户的百分比。我知道这可能是非常基本的,但我不想弄错。

解决方案

其中一些取决于设计的调查 - 是单页还是多页;如果是多页面,您是否在用户从页面到页面或最终等移动时存储数据。我认为最大的问题是单个调查回答是否对应于单个数据库行,或者是否单个调查回复可能会跨多行拆分。显然前者是一切可行的方式。



对于多项选择问题,我将使用INT或ENUM列;确定响应者以特定方式应答的分数是简单的SELECT ... GROUP BY查询。


I am fairly new to MySQL and have a project in which I need to design a database that will store responses from an online questionnaire. Reports will need to be written from the data. Does anyone have any tips on what type of fields to use? The questions will either have a Yes No answer, a choice of 4 options from very satisfied to very dis-satisfied or multipul choice. It's mainly the choice questions that I'm unsure on, as I will need to be able to product a report to show the percentage of satisfied customers. I know it's probably really basic, but I don't want to get it wrong.

解决方案

Some of this depends on the design of the survey - is it single or multi-page; if multi-page, are you storing the data as the user moves from page to page, or just at the end, etc. I think the biggest issue is whether a single survey response is going to correspond to a single database row or whether a single survey response may be split across multiple rows. Obviously the former is the way to go if at all possible.

For the multi-choice questions specifically, I would use either INT or ENUM columns; determining the fraction of respondants answering in a particular way is a simple "SELECT ... GROUP BY " query.

这篇关于MySQL表设计问卷的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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