In a StackOverflow clone, what relationship should a Comments table have to Questions and Answers?

前端 未结 6 1958
盖世英雄少女心
盖世英雄少女心 2020-11-30 06:14

In an application similar to StackOverflow that I am building, I am trying to decide what relationship my Questions, Answers and Comments

6条回答
  •  借酒劲吻你
    2020-11-30 06:54

    You could create a single comments table with two foreign keys, one to questions.questionID and the other to answers.answerId

提交回复
热议问题