Jump to content
Sign in to follow this  

how to configure this relationship

Recommended Posts

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?

Share this post

Link to post
Share on other sites

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.

Share this post

Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

Sign in to follow this  


Important Information

By using this site, you agree to our Terms of Use.