Results 1 to 2 of 2
  1. #1
    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.

  2. #2
    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...

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •