开发者

Relation Table Optimization SuperKey

I have an idea of how to fix this but I was wondering what the best way to go about this.

So one Question can have multiple Answers Question and Answers can have points A user is only allowed to give points per question/answer

Question:
  id
  titl开发者_如何学Ce

Answer:
  id
  question_id
  response

Points:
  id
  user_id
  question_id
  answer_id
  points

So as you can see the problem is the Points table with question_id and answer_id. Now I think I could solve this by having Points_Question table and Points_Answer table, then I could join the tables for total_points. Is this the best solution?


you don't need to add questionid in points table as question can be accessed through answerid in answer table.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜