#1
  1. For POny!
    Devshed Newbie (0 - 499 posts)

    Join Date
    Apr 2012
    Location
    Amsterdam
    Posts
    416
    Rep Power
    115

    Quiz table crossroad


    Hi guys,

    I am at a crossroad. I want to populate a database with questions and possible answers. I was tempted to store these possible answers in a separate table. But than again they will never change so I thought why not add these answers to the question text itself (as in in the same field). The reason I thought that would be good because it allows me to change change the type of question and show for instance possible answers as image or as a list.

    For example.

    Code:
    questions table:
    question field:[
    What is the result of 6*5
    
    A: 2
    B: 4
    C: 30
    ]
    // with one table I will most likely store the answers in an
     answer field just for convenience and control
    instead of
    Code:
    questions table:
    question field:[
    What is the result of 6*5
    ]
    possible answers table:
    possible answer[A: 2]
    possible answer[B: 4]
    possible answer[C: 30]
    What do you guys think? I don't directly see the advantage of storing the possible answers in a separate table. (I do see the advantage of storing the given answers by the person doing the test)

    -edit: let me add that another reason why I thought it would be a good idea to put the anserws in the same table row is for the case of possible answers in the form of images. I would rather combine them to one image to lessen the amount of header requests. Which would happen in case I would store these answers apart in another table.
    Last edited by aeternus; February 28th, 2013 at 06:19 PM.

IMN logo majestic logo threadwatch logo seochat tools logo