I am designing database for an exam, and I am stuck. I do not know how to do it.
Here is the relevant information:
- Student answers 10 questions.
- Each question has 3 options (answers) and student chooses one.
- Only one answer is correct, other 2 are wrong.
- Students can take this exam only once. They can not try again.
- There will be no other exams, this is the only one.
I need help with database design.
What I have tried so far on my own:
Table Students
ID bigint (primary key, identity)
Name nvarchar(MAX)
Table Questions
ID bigint (primary key, identity)
TextOfTheQuestion nvarchar(MAX)
Table Answers
ID bigint (primary key, identity)
TextOfTheAnswer nvarchar(MAX)
QuestionID bigint (foreign key to Questions.ID)
isCorrectAnswer bit
Table StudentChoices
StudentID bigint (primary key, foreign key to Students.ID)
AnswerID bigint (primary key, foreign key to Answers.ID)
This is my personal design for learning purposes. I am trying to learn Entity framework + C# on my own.
Best Answer
Easy on the bigint and nvarchar(MAX)
This is how you score
When the primary query comes out clean it is sign of a good db design