I'm having some trouble to find an easy way to check if a column contains a certain value before updating the value in another column in a table row. For example, if I have the table StudentsParticipationInClass like below
| ID | Grade | State | | 1 | 'U' |'OnGoing'| | 2 | '3' | 'Done' |
I want a constraint that tells the user that to be able to update the state to Done the Grade must be something else than 'U' or NULL.