Having trouble using JOIN in Oracle SQL to pull required information

boothole

New Member
I'm having some trouble finding out the proper way to approach this question.\[code\]Database tables:Student(stdID[pk], stdName, stdSet)Enrollment(stdID[pk], crsID[pk], year[pk], semester[pk], grade)Offering(crsID[pk], year[pk], semester[pk], instrID)Course(crsID[pk], crsTitle, creditHrs)Instructor(instrID[pk], instrName, dept)\[/code\]"Find all instructors who had taught, from 2006 to 2008, a given student A01234567. List the student ID, instructorID, and year. Do not duplicate rows."What I originally had was this:\[code\]SELECT DISTINCT stdID, instrID, yearFROM Student sJOIN Instructor i ON Offering o (o.instrID = i.instrID)JOIN Offering o ON Course c (c.crsID = o.crsID)WHERE stdID = 'A01234567' AND date BETWEEN (2006 AND 2008);\[/code\]However, this is not entirely correct. I have notes that it's something to do with "missing 2 columns from Offering join", but I don't know what that means...
 
Top