I have a table called Enrollment which contains StdID, CourseNumber, and EnrollGrade.
StdID CourseNumber EnrollGrade
101 2201 A
101 2203 B
102 2203 C
103 2203 B
103 2201 C
103 1101 B
I need to create a trigger that will not allow a Student to enroll in CourseNumber 2205 until they have completed 2201 and 2203. I can't figure out how to go through each StdID and see if they've taken 2201 and 2203 yet.
Here's what I have so far:
Create or Replace Trigger Enroll_Rule
Before Insert on Enrollment
For Each Row
--i know i need a select statement here and then and If statement.
and now i'm totally lost. does anybody have any ideas to get me started?? Thanks a lot!