Jump to content

Many to Many self-join


Recommended Posts

I have wrestled with this, but am failing.

I have Students and Supervisors. Supervisors can have more than 1 student, and students will definitely have more than one supervisor. I would like to look at a student record and see their supervisors, and look at a Supervisors record to see all their students. I am assuming this should be in a portal, but I am having trouble with the self joining aspect.

I want to keep them in the one contacts list, as there are other tables (eg Events) that both students and supervisors and other contacts will relate to. That stuff all works well. I think I need a many to many self-join, but I seem to be stuffing it up.

I have created a simple sample database with what I have done so far attached. Please feel free to advise me or edit.  Thank you.

Self join advisors students.fmp12

Link to post
Share on other sites
  • 3 weeks later...

Since there is no Advisor table nor a Student table, there are no primary keys for those entities.

The design choice here is to go with a people table called Everyone and the primary key for that table is the field "PrimaryKey"

The advisor or student role is just an attribute of the Everyone entity, expressed by setting the Advisor ID/Student ID in Everyone and creating a record in the JOIN table to link up someone as advisor with someone as a student.

This is just one of a few ways you can design this.

Link to post
Share on other sites

Just wondering if you can explain how the portals are set up please?  Can't get them to work.  I have attached a pic of my setup.  Thanks.

Screenshot.png

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
  • Who Viewed the Topic

    1 member has viewed this topic:
    David Doscher 
×
×
  • Create New...

Important Information

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