473,569 Members | 2,705 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Storing Multiple Survey Formats and Answers

4 New Member
I am writing a web application with a MySQL backend that will have multiple users taking various surveys. Each survey has a different number of questions; each question has two types of answers: string and enum; each enum has different numbers of values.

I want to be able to dynamically create the survey, assign questions, set question types (string/enum), assign enum variables if necessary, and save the data for each survey.

I am completely lost as to how the structure of the database should be in order to account for the different types of questions and answers. Help is greatly appreciated.
Nov 30 '08 #1
1 3716
Niheel
2,456 Recognized Expert Moderator Top Contributor
Here's a quick mockup

table: survey
table: questions
table: results

Expand|Select|Wrap|Line Numbers
  1.  
  2. survey
  3. -----------
  4. surveyid
  5. surveytitle
  6. surveystartdate
  7. surveyenddate
  8. survey_totalquestions
  9.  
  10. questions
  11. -----------------
  12. questionid
  13. question_surveyid
  14. question_title
  15. question_type(enum,string)
  16. question_string
  17. question_enum_values (can insert array in here corresponding to each enum value)
  18.  
  19. results:
  20. ------------------------------------
  21. survey_userid
  22. survey_id
  23. question_id
  24. question_results
  25.  
That's probably the quick bare bones way i'd attack it. Though you can get very complex with survey collection data. Another way to quickly learn db schema for survey applications is browse through the db schema of an opensource survey application. Try freshmeat or sourceforge to find one
Dec 2 '08 #2

Sign in to post your reply or Sign up for a free account.

Similar topics

5
2155
by: Dan | last post by:
Hi, I want to migrate a survey program to web application and have selected PHP to use a on the server end along with apache and firebird rdms. As developing a web application is much different than a standard app I have some questions: 1) The survey has 50 questions with answers being 1-10. Is it best to store all 50 questions and...
3
6094
by: DarthMacgyver | last post by:
Hello, I recently wrote a survey application. Each question is very similar. The first questions gives me a problem when there are multiple people taking the survey (The Database connection Timed out) I am using the Data Access Application Blocks as ASP.NET (using VB.NET) and SQL 2000. In there first question there can be up to 27...
5
4105
by: DFS | last post by:
I've written several survey systems in which the majority of the questions have the same or similar responses (Yes/No, True/False, scale of 1 - 5, etc). But this latest survey system I'm working on has 8-10 sections, with a variety of question attributes and answer scales. Some items have just a description and require a Yes/No answer,...
1
2758
by: mcr29 | last post by:
I've been asked to build a survey database. The survey is to be dynamic, allowing any number of questions to be part of the current survey. So I've got a Survey table with SurveyDetail, and a Questions table with a column named 'Active' for that purpose. This makes storing answers a bit difficult. Some are multiple choice, in which case it's as...
13
18535
by: franzey | last post by:
This is how the data is organized: vID Answer 12 Satisfied 12 Marketing 12 Yes 15 Dissatisfied 15 Technology 15 No
1
2520
by: Miyagi | last post by:
I am creating a simple "or so I thought" php/mysql survey. There are 3 types of Surveys, with different questions. 1 for Clients, 1 for Employees, 1 for Peers. Questions for each survey are created, editable, removable, and drag/ drop sortable. Options to these questions are dynamic themselves. Basically, everything works except when I try...
0
2089
by: Janet93 | last post by:
If you are involved in the development of scientific computing software, you are invited to participate in a survey on developing this kind of software. If you have already received this request, I apologize for the cross-posting, but I am attempting to advertise to as many developers as possible. I would appreciate it if you could take...
1
3597
by: jerger | last post by:
I have not made a program or page from start yet. I have made modifications to our signoff asp pages like changing the questions, texts, shortening field lengths etc... I also have copied the files and reused them for other domains asp 1: Basically I have a signoff asp script... that asks a. name b. email address (then submit).. this data...
2
1211
by: alex.williams56 | last post by:
I'm relatively new when it comes to access but I think I have a grasp on the basics. I have a very specific problem that requires a little help from someone more experienced. I'm trying to help someone in the field of consulting create a more comprehensive database for their data they collected from surveys. Here's the background: Three...
0
7924
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. ...
0
8122
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that...
0
6284
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then...
1
5513
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes...
0
5219
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert...
0
3653
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in...
0
3640
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
2113
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
0
937
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.