watsmyname Posted August 25, 2009 Share Posted August 25, 2009 hello, well i m on project to make survey application using Mysql (well it doesnt matter what serverside script i m using as i m concerned about mysql only). THe program will be like we put person's name, his area(is selected from combobox, which exist already in the database table), state(is selected from combobox, which exist already in the database table), etc. these are pretty simple. But i m stuck with questionnaires. There would be around 40 questions and almost all have different answer patterns. Some have 5 radio buttons, of which one is to be chosen (if option "other" is chosen, then he should answer on the textbox ). some question have textboxes to input numbers like a question may be to write number of married, unmarried, divorced, widow members in the family. Some questions might have checkboxes that means all of the options can be chosen. And some question might have sub questions depending upon the answer they choose in main question. So i m stuck now how would i make database table structure.. shall i make table for answers for each questions and put person's info and answer to that particular question...or what else can be done any help will be greatly appreciated. Thanks watsmyname Quote Link to comment Share on other sites More sharing options...
kickstart Posted August 25, 2009 Share Posted August 25, 2009 Hi Personally I would have a table of questions also containing the question type (ie, text box / drop down / check boxes / list boxes) with a parent question / answer field for sub questions, a table of possible answers for each question (one row per possible answer per question) and a table of actual answers (one row per person, per answers, with possibly more than one answer per question for text boxes). All the best Keith Quote Link to comment Share on other sites More sharing options...
watsmyname Posted August 25, 2009 Author Share Posted August 25, 2009 Hi Personally I would have a table of questions also containing the question type (ie, text box / drop down / check boxes / list boxes) with a parent question / answer field for sub questions, a table of possible answers for each question (one row per possible answer per question) and a table of actual answers (one row per person, per answers, with possibly more than one answer per question for text boxes). All the best Keith thanks mate, but the type cannot be defined because some question might have both checkbox and textbox, or radio or textbox, etc. One more thing answer could be anything, so there is no fixed answer for any of the question, there is no particular answer for any question, it all depends upon the person who are answering the questionnaire. and some question might have multiple text boxes for answers, for example i have to answer a question "Write down the education status of the following age groups and following genders", in row there would be age groups(like 5-10,10yrs-20yrs and on) and in column there would be two text boxes for male and female thanks again Quote Link to comment Share on other sites More sharing options...
kickstart Posted August 25, 2009 Share Posted August 25, 2009 Hi Does make it more complicated, but I would still use a similar setup. Possibly with an extra table to define questions against sub questions (ie a question with multiple text boxes). Not sure that any solution is going to lool pretty though! All the best Keith Quote Link to comment Share on other sites More sharing options...
watsmyname Posted August 25, 2009 Author Share Posted August 25, 2009 Hi Does make it more complicated, but I would still use a similar setup. Possibly with an extra table to define questions against sub questions (ie a question with multiple text boxes). Not sure that any solution is going to lool pretty though! All the best Keith thanks a ton mate, i will try and let you know Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.