SQL Server的测验数据库设置

时间:2021-07-15 12:46:03

I want to create a database and I am trying to think ahead to the future with results retrieval and the time it takes to perform tasks. Basically, I am going to have a table that hold the answers that were given on the quiz. There are 48 questions. Is it better to have one long row with all of the answers given and the column names after the question number. Or should I have one row with each answer and the question ID. Either way makes sense to me but I am pretty new at this.

我想创建一个数据库,我试图通过结果检索和执行任务所需的时间来考虑未来。基本上,我将有一个表格,其中包含测验中给出的答案。有48个问题。最好有一个长行,给出所有答案,并在问题编号后面添加列名。或者我应该在每个答案和问题ID上都有一行。无论哪种方式对我都有意义,但我对此很新。

1 个解决方案

#1


5  

48 questions/columns are a lot. And what happens if you want to have only 12 or 50 questions tomorrow?

48个问题/专栏很多。如果你明天只想要12或50个问题,会发生什么?

A design like

像这样的设计

player_id | quiz_id | question_id | answer_id

will give you more flexibility in the future.

将来会给你更大的灵活性。

#1


5  

48 questions/columns are a lot. And what happens if you want to have only 12 or 50 questions tomorrow?

48个问题/专栏很多。如果你明天只想要12或50个问题,会发生什么?

A design like

像这样的设计

player_id | quiz_id | question_id | answer_id

will give you more flexibility in the future.

将来会给你更大的灵活性。