Click here to Skip to main content
15,910,277 members
Please Sign up or sign in to vote.
1.00/5 (1 vote)
See more:
Hi all,

I have a questionnaire with 70-80 fields to record. I just want to put it into a database. I wonder that I should create a single table with 70-80 columns and break it down. Or else I can record it page wise. Is there any drawback on that, your feedback warmly welcome.

Thanks
Posted
Comments
Jörgen Andersson 21-Aug-13 13:54pm    
Are you using all the fields equally much?
You can earn some queryspeed if you're using just some of the fields a lot and split them into a separate table that would fit in the memory cache.
Otherwise I wouldn't care
CodingLover 22-Aug-13 2:15am    
Actually all the fields are in different pages. Per page like 10-15 fields to track. So I can split them into different tables.
Sergey Alexandrovich Kryukov 21-Aug-13 14:26pm    
It depends on a number of factors. This is not a sound question...
—SA
CodingLover 22-Aug-13 2:15am    
Could be, but for me something is there :) Thanks for the response.

1 solution

Now I understood your question.

It depends on what kind of questionnaire it is. Text answers or a checkboxes.

If it's checkboxes I'd make a response table having two columns. RespondentID and ChoiceID where every response makes a new line in the table.
With corresponding tables for Respondents, questions and choices.

If it's text answers you'll need three columns: RespondentID, QuestionID and Answer.
Also here you'll need corresponding Respondent and question tables.

If you're just storing the answers in the database you don't need to bother about pages, but if it's a web questionnaire you'll need to store a lot of layout data aswell.
 
Share this answer
 
Comments
CodingLover 22-Aug-13 4:38am    
Thanks for the comment.

Actually it is a mix of text and check boxes. Anyway I like your suggestion, for separate pages I can maintain different tables.

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900