1

New to SX and Just beginning my delve into the world of programming and could use some assistance with this problem.

I need to find out which GROUP of partners from the MentorRelations table don’t have reports in the Reports Table. I’ve so far only managed to cross join the employees and mentee/ mentor codes to figure out the names of the employees and the groups they belong in. (EmployeeCode = Mentee/Mentor Code)

I’m working in a SQL server management studio environment.

The tables I’m working with are in short; MentorRelationship [menteecode,relationshipcode,mentorcode]

Employee
[EmployeeID, EmployeeCode, Firstname,lastname]

UserReport 
[reportID, employeeID]

Report
[ReportID, name, reportgroupID]

So far the code I have worked out is;

SELECT
m.menteeCode,
E1.firstname AS Mentee_FN,
E1.lastname AS Mentee_LN,
m.mentorCode,
E2.firstname AS Mentor_FN,
E2.lastname AS Mentor_LN,
FROM
MentorRelationshipStaging m 
INNER JOIN Employee e1
         ON e1.EmployeeCode = m.MenteeCode
INNER JOIN Employee e2
         ON e2.EmployeeCode = m.MenteeCode
ORDER BY m.MenteeCode

I’m pretty stumped after this, answers or the next steps to go about solving this would be HIGHLY appreciated. I’m also going to continue researching on my end.

P.S. I’ve uploaded a diagram of the databases I’m working with here:
https://m.imgur.com/a/9JMRpFw

Michael B.
  • 13
  • 3

0 Answers0