I am a web developer but I need to include a database for my website but I am very weak when it comes to producing the correct database. My website is an online exam system where users answer questions by selecting answers from the following options given to them.
What I asking is what fields would you include in the answer table, studentanswers table, questions table and I probably need to inlude an options table as there could be different types of options e.g true or false, a,b,c, or even a,b,c,d,e. also some questions may have one answer by selecting one option and other questions may have multiple answers by selecting multiple options.
Thank you and please share me your ideas as I can use then to help build a suitable database for this website.
My Structure so far was this:
Question Table:
TestId (PK)
QuestionId (PK)
QuestionContent
Answer Table:
AnswerId((PK)
AnswerContent
AnswerCorrect
TestId (fK)
QuestionId(fK)
StudentAnswer Table:
Session ID(pK)
QuestionId(pk)
StudentAnswer(pk)
StudentId(pk)
Havn’t implemented options table because I do not know how to do it correctly
I’d suggest maybe showing us what you have so far and then maybe we can help tweak it for you. Here is how I might approach it though but I’d have to think about it more and know more details:
-Have a student’s table with all of the information Name, ID (some type of unique identifier), Year, etc.
-As for the questions and answers I thought of maybe having a table for each type of question but after further though the best approach would be to just simply have one questions table and one answers table for all types of question. This is because there is a variable amount of questions and answers possibilities that you will not know ahead of time.
-In the questions table you will have “Question” (the actual question), “Question Type” (true/false etc.), “Question ID” (Unique ID)
-In the answers table you will simply have “Answer” and “Answer ID” (this is most important and will be a foreign key linking to Question ID in the previous table).
-Finally you will have a Results table with “Student ID” (FK linking to student’s table), “Question ID” (FK linking to Question table), and “Answer” for the student’s answer.