MySql database design for a quiz

后端 未结 3 1543
無奈伤痛
無奈伤痛 2020-12-18 04:19

I\'m making an online quiz with php and mysql and need a bit of help deciding how to design the database for optimal insert of questions/answers and to select questions for

3条回答
  •  爱一瞬间的悲伤
    2020-12-18 04:55

    Go for your first option. It is the most normalised option, but that isn't necessarily a clinching argument. But the virtues of the normalised design are manifold:

    • it is a piece of cake to include new questions into your quiz portfolio. (The other option requires adding new columns to the table).
    • it is simple to write the select statement which returns the result set. (the alternative option requires a dynamic SQL)
    • it is easy to write a GUI which displays the questions and answers, because each displayed set of text maps to the same coilumn_names.

提交回复
热议问题