If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

 
Go Back  dBforums > Database Server Software > MySQL > Survey Question and Answers (was "Newbie needs advice")

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old 04-26-06, 06:54
JimmyMac JimmyMac is offline
Registered User
 
Join Date: Apr 2006
Posts: 1
Survey Question and Answers (was "Newbie needs advice")

I'm trying to design a database for an online survey.

So far I have 2 tables Question and Answers
  • Questions Table
  • "Question Text" VarChar
  • "Number" Integer Primary Auto Inc.
  • "Date Used" DateTime

  • Answers Table
  • "Answer Text" VarChar
  • "Question Number" Int
  • "Respondent Number" Int
  • "Answer Number" Int
  • "Key" Primary Auto Inc


I want to be able to create a report of questions and annswers.

Example:
What is your Gender? Male 20 Female 15

Anyone give advice on this setup and how do I tie these 2 tables together?

Thanks in advance.
Jim
Reply With Quote
  #2 (permalink)  
Old 04-26-06, 07:33
healdem healdem is offline
Jaded Developer
 
Join Date: Nov 2004
Location: out on a limb
Posts: 9,260
I think you need some other supporting tables,
eg question type
this could say there are 5 answers, or it could provide some form of validation rule (which may have to be implmented in a sub table)
having defined your question and you answers you probably also need to have a table containing the answers top level

eg
TblSurvey
SurveyID
SurveyDate

TBLAnswers
SurveyID
QuestionID
SurveyNumVal
SurveyTextVal


HTH
__________________
I'd rather be riding my Versys or my Tiger 800 let alone the Norton
Reply With Quote
Reply

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On