normalization or denormalization

Results 1 to 2 of 2

Thread: normalization or denormalization

  1. #1
    Troy Guest

    Default normalization or denormalization

    Background:<BR>I have a table that stores test questions. Unless I am perfect, which won&#039;t ever be, I will make a mistake creating new questions. If the questions are wrong and people have already taken the test, I plan to void the question completely. Each user will have a test history that stores all info about each test. When the look at the information about a test, the user with be able to see if any questions have been voided. If a user tries to take the test after a question has been marked void I need to skip the test question. To do this I figure I need a voidquestion table which stores all of the IDs of the voided questions. <BR><BR>Now here is the problem...<BR><BR>If I store the voided question IDs in the voidquestion table, this table will have to be seached each time before displaying the question on tests, regardless if it is in the voidquestion table or not. <BR><BR>The only other alternitive to this I can think of is to add a "void" field in the question table. If I want to void a question I just mark this field as true. Although this sounds easier, adding this column would go against normalization rules (I think). Not many questions will be voided, but every question would require the storage of the "void" field.<BR><BR>So I have to choose between doing an extra search for every question being displayed on the test, when 98% won&#039;t require a search, or I have choose adding an extra field and breaking normalization rules. <BR><BR>Can anyone give me any suggestions?

  2. #2
    Join Date
    Dec 1969

    Default add the field

    it&#039;s easier. sometimes it&#039;s possible to &#039;over-normalize&#039; - the hit would be negligible on a bit field, and it&#039;s simpler than joins all over the place.<BR><BR>j

Posting Permissions

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