I am trying to do a check to see if a student meets the prerequisite before they can register for a course section.
CourseSecID = 27 (ID of the course section the student wants to register for.)
What I am doing is querying the student's acad cred records to see if any of the courses matches the prereq that is connected to the course they are wanted to register for. If it matches, then they have met the prereq and can then register for the course section. Below is my query and any help or direction is greatly appreciated. The following query does not return any results, so I need help in figuring out what I am doing wrong.
SELECT acadCred.stuAcadCredID FROM stu_acad_cred acadCred WHERE acadCred.courseCode
IN(SELECT crse.preReq FROM course crse LEFT JOIN course_sec sect ON crse.courseID = sect.courseID
WHERE sect.courseSecID = '27')
GROUP BY acadCred.stuID,acadCred.courseCode