Consider the following many to many relationship A student can take many classes
ID: 3868233 • Letter: C
Question
Consider the following many to many relationship A student can take many classes Many classes can be taken by many students What would be the most appropriate way to handle the foreign keys to maintain this relationship? a) Create a new table that has a foreign key reference to both student and classes b) Create a foreign key in student that references classes c) Create a foreign key in classes that references students d) Combine the two tables into a single table that ahs properties of both student and classes e) This is not possible to model in MySQL and must be handled in the application logicExplanation / Answer
The answer is
c) Create a foreign key in classes that reference students.
This is because relation from Classes to Student is one to many and it will suitably hold the relation between student and class.
Related Questions
Hire Me For All Your Tutoring Needs
Integrity-first tutoring: clear explanations, guidance, and feedback.
Drop an Email at
drjack9650@gmail.com
drjack9650@gmail.com
Navigate
Integrity-first tutoring: explanations and feedback only — we do not complete graded work. Learn more.