Note that there are some explanatory texts on larger screens.

plurals
  1. POCore data database design issues
    text
    copied!<p>I want to create a core data model to store user input questions and then entries for those questions.</p> <p>The questions will be 1 of 3 types. (1-10, Yes No or a number of specific units). So users will go into the app, click "add question" and will be shown a form where they will input the <strong>question title</strong> choose the <strong>question type</strong> (Yes/No, Scale 1-10 or Specific Units) - and if they choose specific units they have to put in those units eg: centimetres, millimetres, litres etc...</p> <p>There will be multiple entries to these questions mapped over a period of time. IE: Users may put in the questions "How tall is your tomato plant? - specific units - CMs" and "How red are your tomatos? - scale 1-10" and will go back into the app time and again to map out the progress over time.</p> <p>My question is about database design for this. How would I set this up in my core data?</p> <p>At the moment I have this:</p> <p><img src="https://i.stack.imgur.com/yoBX7.png" alt="enter image description here"></p> <p>Now, I'm stuck! I don't quite know how to account for the fact that questions have different types, and therefore the entries will be different.</p> <p>Plus I need to account for questions where units may be required. These are the questions that will just be a number.</p> <p>So I'm thinking I probably need different question entites. Something like having a Questions entity and the specific questions as sub-entites - but I'm not sure how to do this, and not sure how to then record the entries made to those questions!</p> <p>Thank you for looking, and for helping if you can. :)</p>
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload