I'm trying to model a site similar to StackOverflow. It has a set of users and questions, and user vote on questions. Each user can only have one vote on each question.
What should the structure of my "VotesOnQuestions" table look like:
- Should I have an auto-generated "VoteID" column?
- How do I disallow, at the schema level, a user from having multiple votes on a question?
- Should I, instead of a VoteID column, just use (UserID, QuestionID) as a primary key?