Suppose there is an employee table with columns EmployeeID, Name, Gender etc and there is a Leaves
Fantastic news! We've Found the answer you've been seeking!
Question:
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.
Related Book For
Income Tax Fundamentals 2013
ISBN: 9781285586618
31st Edition
Authors: Gerald E. Whittenburg, Martha Altus Buller, Steven L Gill
Posted Date: