I'm creating a small questionnaire, with below database design; following the schema from this thread made by Michael Durrant, with slight modification.
Now, for some questions, I must provide cities as options of answers; which already there in master_cities table. Eg: Which city do you reside now?
Answer will be in dropdown format which derived from a master_city table. I shouldn't copy the whole content of master_cities_table into option_choices table, should I???
Any ideas are greatly appreciated.
Edit: I'd like to clarify the question.
- This question is totally unrelated with UI/UX, pure db design.
- The goal I'm trying to achieve is to avoid data redundancies such as copying master table records into options_choices.
- Since it's a survey system, all the choices of answers must be database-driven, like A. Strongly agree, B. Neutral, C. Totally disagree. Which could be reused to answer other questions, like "Where were you born?" or "Which cities have you lived before?"
- Master_cities table here is only one of the master tables (and the biggest) that I need to refer to provide choices of answers.
Hope that clears the confusion.
Current approach:
- I removed the
referral_table
field inoptions_choices
table and put it inside theoptions_group
table instead, - set
option_choice_id
inanswers
table as NULL-able, - and save the
master_cities
primary key as text inanswers_text
field.
That seems to work.
But, there maybe a better approach out there, so you're welcome to share your insights, oh db experts!