Poll Database Schema Poll Database Schema mysql mysql

Poll Database Schema


The schema looks good, and yes, you'd need to track the user votes as well.


Note: the "votes" column of the poll_answers table isn't necessary. Votes can be determined by querying the Poll_voting_history table.


I think that question_id in poll_voting_history is not necessary as well, since each answer points to a question, so based on a answer_id you can get the question_id that it belongs to.