I assumed that students could be in different teams in each course, i.e. team A in course 1 and team B in course 2 so I was joining with team_memberships to make sure the student IDs matched.