February 5, 200916 yr I have a table with STUDENTS and I want to set up relationships between some of them. We have a mentoring program and in any particular academic year some students (upperclassmen) will be "Mentors" for new majors "Mentees". There will be new Mentor-Mentee pairs in successive academic years. I want to keep track of this. So, I want a unique identifier for a Mentor-Mentee relationship and I want to keep track of who's the mentor and who's the mentee in each relationship. So it seems like I need a "Mentor-Mentee" Table that has a unique record key, but I'm not sure what kind of foreign key to use to link students in. Should I have a mentor_fk and a mentee_fk, and should each of these link to the unique key for each student. Can I link twice to a student from this table? Or is there a better way to set this up?
February 6, 200916 yr I think you are on the right track. You do not need a primary key field but 2 foreign keys which combine to make the primary key as in a many to many relationship. Both foreign keys would relate to the primary key of the student table. I would record the year in this table.
Create an account or sign in to comment