Jump to content

Some guide would be appreciated for creating mysql database tables


watsmyname

Recommended Posts

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

Link to comment
Share on other sites

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

Link to comment
Share on other sites

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

 

Link to comment
Share on other sites

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

Link to comment
Share on other sites

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

 

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.