We need to survey our contacts by asking them various questions and recording their responses. Some questions are standard and must be included in every survey (default questions), while others are specific to individual surveys and created as needed.
To effectively manage these questions, we must store both default and personalized questions, as well as the responses from our contacts. Users should have the ability to add new questions, archive old ones, and arrange them in any order they prefer.
Was thinking default questions follow a many-to-many relationship because each default question can be used in multiple surveys, and each survey can contain multiple default questions.
Was also thinking that personalized questions, on the other hand, follow a one-to-many relationship because they are unique to specific surveys and are not reused. For these questions, we will have a table that links specific questions directly to the survey table, including their order.
Does it make sense to separate the questions into different table-relations, many-to-one (personalized questions) vs. many-to-many (default questions on every questionnaire) based on their distinct roles?
I tried keeping all the questions in one table, but it doesn’t make sense to me, to have all questions banked in a question table, when the vast majority of them will not be used across all surveys.
Moochcar is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.