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 Access DB with Question Content

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old 09-29-03, 19:39
tk7 tk7 is offline
Registered User
 
Join Date: Sep 2003
Location: Michigan
Posts: 1
Design Access DB with Question Content

I have been developing databases for quite a few years: multixs, oracle,
db2, MsAccess. However, I have not designed db's that are question heavy. For example:

I have a page of information that needs to be filled out by and interviewer. The pure data fields are no problem about how to store and retrieve. The question data is another story.

There can be a question such as:

Do you feel good about this ...... yes no checkboxes
if yes check all of the following that apply.
this list could be long.

Short of storing every question as a column is there a better way
to set this up in a more generic sense.

This interview type scenario goes on for 12 pages.
Reply With Quote
  #2 (permalink)  
Old 09-30-03, 05:49
andrewst andrewst is offline
Moderator.
 
Join Date: Sep 2002
Location: UK
Posts: 5,171
Re: Design Access DB with Question Content

You need to classify the different types of questions that you must handle. So far you have identified:
1) yes/no questions
2) "check all that apply" questions

There could also be:
3) "select just one answer from list" (like radio buttons)
4) free text reply
...etc.

Then you can build a data model to support those question types, e.g.:

Question( q_id, q_text, q_type );
Question_Options( q_id, o_id, o_text );

q_type here identifies the type of question from the above categories. So the data might look like:

insert into Question( q_id, q_text, q_type ) values (1, 'Do you like cheese?','YESNO');
/* No Question_options required for YESNO type */

insert into Question( q_id, q_text, q_type ) values (2, 'Which types of cheese do you like', 'SELECT_MANY' );
insert into Question_Options( q_id, o_id, o_text ) values (2, 1, 'Wensleydale' );
insert into Question_Options( q_id, o_id, o_text ) values (2, 2, 'Cheddar' );
insert into Question_Options( q_id, o_id, o_text ) values (2, 3, 'Brie' );
insert into Question_Options( q_id, o_id, o_text ) values (2, 4, 'Camembert' );


insert into Question( q_id, q_text, q_type ) values (3, 'Which is your FAVOURITE cheese?', 'SELECT_ONE' );
insert into Question_Options( q_id, o_id, o_text ) values (3, 1, 'Wensleydale' );
insert into Question_Options( q_id, o_id, o_text ) values (3, 2, 'Cheddar' );
insert into Question_Options( q_id, o_id, o_text ) values (3, 3, 'Brie' );
insert into Question_Options( q_id, o_id, o_text ) values (3, 4, 'Camembert' );

etc. You get the idea?

Next, of course, you will need to design the tables to hold the answers...
__________________
Tony Andrews
http://tinyurl.com/tonyandrews
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