Database structure for polling system

0

I have a project to develop an online survey system. I'm worried about how I'll get the answers to the questions to show on a chart. Each chart is each question being analyzed. Let's see, if I have a question that has 4 different answers, and that each question, only one answer can be marked. Basically, the structure would be:

1) pergunta um
   a) questao um
   b) questao dois
   c) questao tres
   d) questao quatro
   e) questao cinco
2)
   a) questao um
   b) questao dois
   c) questao tres

I need help to define the best criteria for storing these responses in the database. Basically, I need to know how many times in question 1, a, b, c, d, and, was selected to be shown the graph of question one. If I had a table in the following structure:

id_usuario 2
respostas ac

In this case user id 2 would have answered question 1, letter a and question 2, letter c. But the point would be, if I treated this in programming it would be too much work for me. I would like to know how best to develop this system by following these criteria.

    
asked by anonymous 20.10.2015 / 20:25

1 answer

0

In this case you need to configure the database (opcao_id, response_id, id_user) as a single index or deal with PHP at the time of insertion.

    
20.10.2015 / 21:02