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.
精彩评论