Objective: The Leaves Management and Payroll system requires the official weekend hodiday scheme stored in the database to be referred to while generating the monthly salary for each employee in the organisation. Generating flexible Database Schema for storing the weekend scheme is the objective.
Problem:
The database schema should be flexible enough to allow the changes in the definition of a weekend. The weekend in our scenario may be defined as:
1. Sunday
2. Sunday + 1st or 2nd or 3rd or 4th Saturday
3. Sunday + (1st and 2nd) or (1st and 3rd) or (1st and 4th) or (2nd and 3rd) or (2nd and 4th) or
(3rd and 4th) Saturday
4. Sunday + all Saturdays