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 > General > Database Concepts & Design > Design question - user created form fields

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old 04-18-08, 03:17
mondenyo mondenyo is offline
Registered User
 
Join Date: Apr 2008
Posts: 2
Question Design question - user created form fields

I have a personal project that I'm planning to implement, but having difficulty with coming up a good solution to below problem.

The basic idea is to provide a simple tool for users to collect data from other people ( similar to a survey ).
Users will be able to create several (up to 20) form fields. I can dynamically create a database table for each user-created form, however this doesn't sound like a good solution.

What would be the best way to do this? I'm planning to use Postgresql for this project. I don't know much about Amazon's SimpleDB, or Google's BigTable. Can those serve better to my problem?

Thanks for any help...
Reply With Quote
  #2 (permalink)  
Old 04-18-08, 03:56
pootle flump pootle flump is offline
King of Understatement
 
Join Date: Feb 2004
Location: One Flump in One Place
Posts: 14,905
Hi

Just have a table of questions, a survery table and a survey_questions table. In the survey table pop in a row for detais about the survey (who's doing it, name of survey etc). In survey_questions two columns - question_id and survey_id. There will be up to 20 rows per survey.

This is a very basic deign and you might well need more tables eventually but it covers the problem you discuss and no need to dynamically create tables.
__________________
Testimonial:
Quote:
pootle flump
ur codings are working excelent.
Reply With Quote
  #3 (permalink)  
Old 04-18-08, 04:01
healdem healdem is offline
Jaded Developer
 
Join Date: Nov 2004
Location: out on a limb
Posts: 9,246
questionaires are realtively easy.. providing your questrions are yes/no, or multiple choice. after all its a simple column 1= quesstion 1 answer, column2.... and so on.


yes no is effectivley a restricted multiple choice.
you store the value of the relevant choice int he relevant column

say 0=No, 1= Yes, 3 = undecided
or -2 strongly disagree, -1 disagree, 0 neutral / dont care, 1 agree, 2 strongly agree

the problem is when you ask the users opinion in a free from text box, or your choice allows other (please expand)

however all is not lost

you can define a question type, and fromt hat decide what type of control / question layout to present to the interviewee. but that is a lot more complex than a simple questionare
Reply With Quote
  #4 (permalink)  
Old 04-18-08, 10:47
architect architect is offline
Registered User
 
Join Date: Oct 2007
Location: Chicago, IL
Posts: 82
I have a data model for this scenario...will try to post some info later today if I get some free time from meetings
Reply With Quote
  #5 (permalink)  
Old 04-18-08, 12:17
mondenyo mondenyo is offline
Registered User
 
Join Date: Apr 2008
Posts: 2
Thank you for the replies.

@pootle flump I liked your suggestion. It solves my problem. I'll probably end up with a huge table (question_id, answer).

@healdem Unfortunately, fields can be any type (date, boolean, text etc.)

@healdem Looking forward to your solution.
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