If you had to save the answer of an exam, and the exam had 1000 questions. Will you save the answers like
OPTION #1:
COLUMNS: EXAM_ID | USER_ID | Q1 | Q2 | Q3| ... | Q1000
Ej of a row
1 | 1 | a|b|c|d......|x
OR
OPTION #2:
COLUMNS: EXAM_ID | USER_ID | Q_ID | ANSWER
EJ
1 | 1 | 1 | a
1 | 1 | 2 | b
1 | 1 | 2 | c
Why?
how to save answers
Moderator: General Moderators
Re: how to save answers
Hi,
I would prefer the second solution, because, creating 1000 columns isn't a nice job and displaying it with a database managment tool won't be possible.
And:
With option#2 you can easily extend your system. Maybe the new test have 1010 questions or just 990? And what happen if you create a second test with just 50 questions?
With option #2 you can store the answers for each test in your database. You could theoretical also store the answers for a multiple choice question. This won't be possible with Option #1.
I would prefer the second solution, because, creating 1000 columns isn't a nice job and displaying it with a database managment tool won't be possible.
And:
With option#2 you can easily extend your system. Maybe the new test have 1010 questions or just 990? And what happen if you create a second test with just 50 questions?
With option #2 you can store the answers for each test in your database. You could theoretical also store the answers for a multiple choice question. This won't be possible with Option #1.
Re: how to save answers
thank you.
- aceconcepts
- DevNet Resident
- Posts: 1424
- Joined: Mon Feb 06, 2006 11:26 am
- Location: London
Re: how to save answers
To normalise it further you could create an additional table to house user id with exam id thus there would be no need to have exam id in option#2.