After doing some research I need some advice. This is a small project which allows teachers to post assignments online, and students to view/submit those assignments.
Students can have multiple courses assigned to them, so my question is: What is the best way to set up a table?
Example 1:
student courses
John Smith Math, Chemistry, English
Mary White Math, Biology
Example 2:
course students
Math John Smith, Mary White
Biology Mary White
Chemistry John Smith
English John Smith
I apologize in advance if this is a noobie question, but I want to avoid doing things wrong from the get-go and I’m open to any and all suggestions!
Thank you for your time.
It’s generally not suitable to put more than one item in a column in a relational database. So create a table like this:
Then, you can use this table in JOIN expressions to retrieve the info you want. You may want to have additional tables that describe the essential information about courses and students. Something like:
and
…or whatever information you need to keep about courses and students.