I’m a newbie making a really simple app in rails, but I have no experience structuring databases…Can you tell me if there’s an advantage to either way presented below or if there’s a better third way to set it up?
The students will be asked two questions on a form
- “Which courses do you think students will likely fail?” (Check all that apply)
Math, English, French, Science
- “Which courses do you think students will likely pass?” (check all that apply)
Math, English, French, Science
For the database, do I create a “pass” and a “fail” column of type “string”. So that, for example, for User1
“Pass” might have Math and English, and
“Fail” might have Science
and for whatever reason, he didn’t offer an opinion on French..
or should I make columns “Math” “French” “Science” “English” of type ‘string’ and then have “pass” or “fail” entered into each column
What is the better way to organize it?
I’d probably create 4 tables, User, Course, ExpectedResult and UserCourseExpectedResult which links the first 3 tables together.
This provides future flexibility in case your expected results include additional values.
The table structures would be along the lines of