Database Schema for survey polling application with a default choice.
Posted
by user156814
on Stack Overflow
See other posts from Stack Overflow
or by user156814
Published on 2010-03-30T23:13:51Z
Indexed on
2010/03/30
23:23 UTC
Read the original article
Hit count: 483
I have a survey application, where users can create surveys and give choices for every survey. Other users can choose their answers for the aurvey and then polls are taken to get the results of the survey.
I already have the database schema for this
Questions
id
, user_id
, category_id
, question_text
, date_started
Answers
id
, user_id
, question_id
, choice_id
, explanation
, date_added
Choices
id
, question_id
, choice_text
As for now, users can choose their own choice answers to their surveys... but I want to be able to add a default "I dont care" or "I dont know" choice to every survey for people who simply dont care about the topic to take sides or who cant choose.
So lets say theres a survey that asks who was a better president, George W. Bush, Bill Clinton, Ronald Reagon, or Richard Nixon... I want to be able to add a default "I dont care" option.
I was thinking to just add that extra choice EVERY TIME a user creates a survey, but then I wouldn't have much control over the text for that choice after that survey has been created, and I want to know if theres a better way to do this, like create another table or something
Thanks
© Stack Overflow or respective owner