Storing a multiple choice quiz in a database - deciding the schema

后端 未结 2 1407
天涯浪人
天涯浪人 2021-02-01 23:35

I am trying to implement a multiple choice quiz and will want to store all my questions and answers in a SQLite database. I will have many questions, and for each question there

2条回答
  •  难免孤独
    2021-02-02 00:14

    It seems deadlock (circular loop) as questionID column is referred as foreign key in answers table and correctAnswerID column is referred as foreign key in questions table.

    It's better to create a bit type column in answers table to marked the correct answer and remove correctAnswerID column.

提交回复
热议问题