0

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
  title

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?

Atherion
  • 584
  • 1
  • 5
  • 14

1 Answers1

0

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

Tassadaque
  • 8,129
  • 13
  • 57
  • 89
  • so you mean in points table either you have answerid or questionid along with other fields. if this is the case then see this link http://stackoverflow.com/questions/3407951/best-way-to-design-this-database-scenerio i would prefer solution proposed by martin. You need to make two junction tables answer_points and quetion_points. – Tassadaque Sep 28 '10 at 16:05