Results 1 to 3 of 3
  1. #1
    Join Date
    Jan 2007
    Posts
    3

    Unanswered: dtabase design for storing true/false questions

    Hai,

    I am trying to design a database for storing trule/false questions.
    I have no need to store any thing like chapters are topic. I want to just design a bare minimum tables for just storing questions and its responses.
    So does the following tables and fields suffice to achieve that?.

    Questions_table(id(autogenerated),course_id,Questi on(text type))
    id field uniquely identify each question, course_id(ex:CRS235) is used to identify which course a particular question belongs to, and Question filed store actual question.

    Response_table(id,response)
    Response field is of int type, 1 for correct answer, 0 for wrong answer. I am not storing options for each question because every question has same options that is True/False.

    So, will this work. Please advice and I would appreciate if any one can point me to a good resource on the web.

    Thanks,

  2. #2
    Join Date
    Jan 2006
    Location
    Singapore
    Posts
    47
    yes. You might also want to add a NOT NULL constraint to the column
    -----------------
    KH


  3. #3
    Join Date
    Jun 2003
    Location
    Ohio
    Posts
    12,592
    Provided Answers: 1
    I'd use smallint rather than int, for saving space and for efficiency.

    I would not use bit, as you would have to convert to smallint every time you wanted to run an aggregate function.
    If it's not practically useful, then it's practically useless.

    blindman
    www.chess.com: "sqlblindman"
    www.LobsterShot.blogspot.com

Posting Permissions

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