473,405 Members | 2,167 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,405 software developers and data experts.

Storing Multiple Survey Formats and Answers

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 3690
Niheel
2,460 Expert Mod 2GB
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
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...
3
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...
5
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...
1
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...
13
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
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...
0
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...
1
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...
2
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...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
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,...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
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,...

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.