[thelist] Survey database design for storing responses to multiple-choice q uestions

Warden, Matt mwarden at mattwarden.com
Mon May 20 14:40:03 CDT 2002


On May 20, Ben Gustafson had something to say about [thelist] Survey...

>--
>[ Picked text/plain from multipart/alternative ]
>I'm designing a database to store responses to an on-line customer survey.
>One of the design dilemmas I'm running into is how to store responses to
>"check all that apply"-type multiple-choice questions, where a respondent
>can choose between all and none of the response choices. I was thinking of
>something like:
>
>---
>tblQuestion
>  question_id (pk)
>  question_text
>
>tblRespondent
>  respondent_id (pk)
>  name
>  ...
>
>tblResponses
>  question_id (pk, fk)
>  respondent_id (pk, fk)
>  response_text (pk)
>---

depending on your application, you might be able to use a comma-delimited
list of response_id's. your referential integrity (by the db, anyhow) is
out the door, but it makes it easy to find whether a checkbox should be
checked or not (just do an instr() ).

it's a bit ugly, bit it's an idea.

i dont quite understand your size problem (aren't your id's integers, or
no?), so i can't help you there.

--
mattwarden
mattwarden.com




More information about the thelist mailing list