Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7005563
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 27, 20262026-05-27T21:22:01+00:00 2026-05-27T21:22:01+00:00

My question is in regards to normalizing data. INFO I’m trying to tabulate test

  • 0

My question is in regards to normalizing data.

INFO

I’m trying to tabulate test results in a database. The information I’d like to record is test_instance, user_id, test_id, completed(date/time), duration (of test), score, incorrect questions and reviewed questions.

For the most part, I think I’d organise the info according to TABLE 1, but I’ve come a little unstuck trying to work out the best way to record incorrect or reviewed questions. Please note that I DON’T want to put all the incorrect questions together in one entry as per TABLE 2.

I’d like to make a separate entry for each incorrectly marked question (or reviewed question).

NOTE: Reviewed questions are ones that at one time or another were marked incorrectly and hence need to be tested again.

TABLE 1

-------------------------------------------------------------   
|  instance   | user_id | test_id |completed |duration|score|   
-------------------------------------------------------------   
|      1      |   23    |   33    | 2JAN2012 |  20m   |  75 |   
|      2      |   11    |   12    | 10DEC2011|  35m   | 100 |   
|      3      |   1     |    3    | 3JUL2008 |  1m    |   0 |   
|      4      |   165   |   213   | 4SEP2010 |  10m   |  50 |   
------------------------------------------------------------- 

TABLE 2

------------------------
|  instance   ||wrong Q|
------------------------
|      1      || 3,5,7 |
------------------------

Ultimately, I’d like to know how many times a user has gotten a particular question wrong over time. Also, I need to keep track of which test the wrong questions came from. This is the same for the reviewed questions.
Incidentally it’s possible for questions to be reviewed AND wrong in the same instance.

I’ve come up with 2 different ways to represent the data, but I don’t like either of them.

------------------------------------------------- 
|  instance   | Q number |  Wrong  |  Reviewed  |
-------------------------------------------------

OR

---------------------------------------------------
| user_id | test_id | Q number | Wrong | Reviewed |
---------------------------------------------------

Note: Wrong/Reviewed category is counting how many times the Q number falls into that category.

MY QUESTIONS SUMMARISED

How can I efficiently represent wrong/reviewed questions in a table? Is TABLE 1 set up efficiently?

EDIT : Questions that have been answered incorrectly can be used to generate new tests. Only incorrect questions will be used for the tests. If a generated test is taken, the questions tested will be marked as reviewed. The score will not be updated as it will be a new test and a new test_id will be generated.

NOTE-It is possible to retake old tests, but the score will not be updated. A new instance will be created for each test that is taken.

In regards to the generated tests, I guess this means I will need to include one more table to keep track of which quiz the questions originally came from. Sorry- I hadn’t thought it all the way through to the end.

THANKS

It was difficult for me to choose an answer as everyone gave me really useful information. My final design will take into consideration everything you have said. Thanks again.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-27T21:22:01+00:00Added an answer on May 27, 2026 at 9:22 pm

    Talking about normalization, and just to make sure that you can retrieve all kind of calculated data out of your database, I’d propose a more complex model, which will end up in something easier to manage…

    You’ll need the following tables

    test_table
        PK: id_test
        testDescription
    
    question_table
        PK: id_question
        FK: id_test
        questionDescription
    
    instance_table *please note that duration and scores will be calculated later on
        PK: id_instance
        FK: id_user
        FK: id_test
        startingTime
        endingTime
    
    question_instance_table
        PK: id_question_instance
        FK: id_instance
        FK: id_question
        questionResult (Boolean)
        (please note here that the PK could be id_instance + id_question ...)
    

    Back to your needs, we then have the following:

    • duration is calculated with startingDate and endingDate of instance_table
    • score is calculated as the sum of True values from questionResult field
    • you can track and compare answers on same question over time for one user
    • thus your reviewed questions can be defined as questions with at least one false value for a specific user
    • if your database supports null values for boolean fields, you’ll have the possibility to follow unanswered questions (with questionResult = Null). Otherwise, I advise you to use or build a three states field (integer with Null allowed, plus 0 and 1 values for example) to follow unanswered questions (null), wrong answers (0), and correct answers (1).
    • Score, being 100 * (number of good answers)/(number of questions in the test), can easily be calculated via SQL agregates.
    • You could even calculate partial scores as number of good answers/number of questions answered in the test.
    • This model accepts any number of tests, any number of questions per test, any number of instances, any number of users…
    • Of course, it can be further improved by adding missing properties to tables (testNumber, questionNumber fields for example)
    • etc…
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

This question is in regards to the V8 C++ API. I would like to
In keeping with the Repository pattern of data input, I've a question in regards
My question regards how to design a database. I have one table, called posts,
We have a question with regards to XML-sig and need detail about the optional
a quick question in regards to table design.. Let's say I am designing a
I had posted a question in regards to this code. I found that JTextArea
I have got a question with regards to upgrading asp.net mvc applications from v1
I'm pretty sure this is a simple question in regards to formatting but here's
This question is in regards to this blog entry. https://blog.stackoverflow.com/2008/07/easy-background-tasks-in-aspnet/ All the way at
I bumped into an additional question that I needed in regards to this: Using

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.