2
I have a doubt in the structure of some tables and I hope you can clarify in detail below.
Setting
The system will generate a way to create forms and questions dynamics, in order to be answered by users already registered. The answers should also be stored.
A form can be associated with N clients in the same way that a client can be associated with N forms. Only forms associated with the user can be answered. The forms will have a set of questions and in another table will be provided the answer of each user.
Doubt
It is necessary that the form is associated with the user to allow him to answer it, so I created two diagrams. Which one is best used?
Diagram 1
Through the table Usuario_Formulario
is associated with the forms that each user can answer and in the table Resposta
, will store each answer (referring to the question form) of the user.
Diagram 2
In this second diagram, I remove the direct relationship of Usuario
-Resposta
and make the relationship appear between Usuario_Formulario
-Resposta
Is there any other better way to create this structure? It can mess with the relationships and keys of each table.
OBS: Do not take into account the issues of non-key fields, just created a few to give a better view of the problem.
would use diagram 2. Would make some changes to have alternatives in case of objective questions and if necessary use the same question in multiple forms
– Rovann Linhalis
Can the same question participate in more than one form? // Is the numbering of each question general or is it by form? // What is the difference between users and customers?
– José Diz
Did any of the answers solve your question? Do you think you can accept one of them? Check out the [tour] how to do this, if you haven’t already. You would help the community by identifying what was the best solution for you. You can accept only one of them. But you can vote on any question or answer you find useful on the entire site (when you have enough score).
– Maniero