Lets say you have the following questions on a survey that you need to transpose into a database then use in a webapp:
During the last weekend, which of the following did you eat?
- ice cream
- salad
- fried chicken
In the above we make the connections automatically. But in order to have the questions make sense in the database should they be stored like this?:
- During the last weekend, did you eat ice cream?
- During the last weekend, did you eat salad?
- During the last weekend, did you eat fried check?
Say you're using a design like Micheal's, it would seem reasonable to store them in tables like so:
[During the last weekend, did you eat ice cream] -> questions_table.question_name
[Yes/No] -> Option_group_table.option_group_name
[Yes][No] -> option_choices_table.option_choice_name
[True or False] -> answers_table.answers_yn
yet if wanted you wanted to build a wepage from this data it would be cluttered to display:
- During the last weekend, did you eat ice cream?
- During the last weekend, did you eat salad?
- During the last weekend, did you eat fried check?
Should the front end webapp take care of this? Through some means like regex?
Function_to_help_properly_display_string("String")
The con's to this approach seem to be that different questions.question_names (strings) couldn't be handled the same way. For example:
Which of the following did you goto on the weekend?
- Germany
- France
Couldn't be handled the same way as our original question.
Or should the database account for this possible having more columns?
[Question table]
[question.heading] -> During the last weekend, which of the following did you eat?:
[question.list] -> ice cream
[question.full] -> During the last weekend, did you eat ice cream?
The cons to doing something like this is it seems repetitive and cluttered.
Most likely their is a third option that i'm not presenting, feel free to share it! Thanks in advance,