Re: storing survey answers of different data types

From: Gene Wirchenko <genew_at_ocis.net>
Date: Thu, 23 Apr 2009 14:30:10 -0700
Message-ID: <iom1v4tpg2apkarbpf811ka3jltlfanpdn_at_4ax.com>



lawpoop <lawpoop_at_gmail.com> wrote:

[snip]

>Suppose I wanted to compile a report of the responses. Am I to look up
>the questions from documentation, type them in, and produce the
>report? Why not store them electronically? In a database? Why not
>store them in the same database, in the same questionnaire where they
>originated? Why not put them right where I need them, so I don't need
>to refer to documentation when I make a report, but instead I can just
>throw another column into the query?

     The question might well belong in the database; it probably does, but it depends on what you are modelling. It does *not* belong in the table of responses. If you put it there, each row of answers for a questionnaire would have the same questions text which is redundant (or silly).

>I don't really care that someone responded "Yes" to the first
>question, or that 72% of respondents answered "3" to the fourth
>question. I *do* care if someone says that they did use tech support
>in the past month, or if 72% said that their experience with tech
>support was "average". Why doesn't the question belong in the
>database, especially when the point of this design is to handle
>questionnaires that can be completely different?

     Note that database and table are two different things. You might have:

Question Table
-
Questionnaire Number
Question Number
Question Type
Question Text

Responses to Questionnaire 58 Table
-

-- Lame Column Name             -- Friendly Column Name ----
Question 1 Response    text     Name
Question 2 Response    int      Age at Time of Questionnaire
Question 3 Response    text     Opinion of Prime Minister     
Question 4 Response    text     Opinion of Opposition Leader

[snip]

Sincerely,

Gene Wirchenko

Computerese Irregular Verb Conjugation:

     I have preferences.
     You have biases.
     He/She has prejudices.
Received on Thu Apr 23 2009 - 16:30:10 CDT

Original text of this message