I have 2 tables in my data in SQL. One is Class and another is EXtra_Hours, basically, I want to calculate the amount school should pay in extra hours to teachers.
Table Class has the following attributes:
- class_id
- hourly_rate
- class_type
Table tab_extra_hours has the following attributes:
- teacher_id
- class_id
- extra_hours
- amount_extra_hours
I'm trying to create a trigger so that everytime I update the number of extra hours, having in consideration the class_id (because each class_id has a different hourly rate) it automatically updates the amount_extra_hours in EUR that the teacher should get.
Can someone help me?
Thanks!