I would like to do a trigger with a join included.
I need to, dont allow a mechanic to be inserted if he is marked as inactive. I have the table machanic with an attribute called MecActiv that can be active or inactive, also i have a table called reparation that have a foreign key to the table mechanic. If this attribute on mechanic is inactive, that mechanic cant be on the table reparation so i need a trigger with a join, i cant found how to do it.
Thanks!
P.S: I need the code in Mysql