I am looking for some help on setting up the database for a survey type app I’m building. I’m converting this from an Access database and having some trouble switching from SQL to a Bubble schema.
App Summary
In this application, there are several Categories, each with its own list of questions. A user would fill out a survey for only one Category at a time. In other words, when the user starts a survey, they select the category, and only the questions related to that category would be shown.
The questions all have multiple choice answers, either Y/N or a different list of options. Each question can have an optional related sub-question, for example; if question 1 is answered No, then question 1a would ask for more detail about Question 1.
Also, users create comments that should be tied to a question.
I’m not sure where to start with my data types, and if I should set questions as a list of things, or each question should be its own thing. And then how do I generate the survey and relate the questions to the answers?
I don’t want to introduce any confusion but I want to give a example about what I was thinking.
Question has a related field for Category
Subquestion has a related field for Question
Comments has a related field for user and question or subquestion.
I now do wonder when to choose for a related field (list of values), or a related field (single value) or when to use both and when? This from a functional and performance perspective.
Category
CategoryName
Questions (List of type Question)
Question
Question Number (for ordering)
Question Title
ResponseOption (see below)
Sub-Questions( List of type Sub-Question)
Comment (List of type Comments)
Sub-Question (This would have mostly the same fields as Question)
Question Number
Question Title
ResponseOption
Comment (List of type Comments)
Comment
CommentText
Created By
Then I need to store the possible answers to each question. Y,N,NA on Questions and various other responses on Sub-Questions. So I should probably create another type called Responses?
Responses
ResponseOption (List of Texts)
Then, I think I would need a data type to store completed surveys right? How does this look?
CompletedSurvey
Category
Answer(List of Texts) Or, would the Answer field go under the Question and Sub-Question Type?
Created Date
Creator