Fill This Form To Receive Instant Help
Homework answers / question archive / Suppose there is an employee table with columns EmployeeID, Name, Gender etc and there is a Leaves table with Totalleaves, RemainingLeaves and Status where status is either 0 or 1 and denotes if the employee has taken leave or not for a particular day (0- no leave, 1-leave taken)
Suppose there is an employee table with columns EmployeeID, Name, Gender etc and there is a Leaves table with Totalleaves, RemainingLeaves and Status where status is either 0 or 1 and denotes if the employee has taken leave or not for a particular day (0- no leave, 1-leave taken).
How can we check and update if an employee is eligible to take leaves based on RemainingLeaves in a Leave table where RemainingLeaves should be more than 5?
Should we use a trigger or stored function because we want to update the eligibility is a column too so we can check later on?
Use MYSQL, please elaborate as well.