PL/SQL Problem
431621Oct 21 2004 — edited Oct 25 2004Hey guys I have to finish off this PL/SQL assignment but this one problem is giving me hell. Could any kind soul please help me. My schema goes like this:
Employee (F-name, L-name, SSN, birth-date, address, sex, salary, supervisor-SSN, department-no, start-date)
Department (department-name, d-number, Manager-SSN, Manager-start-date)
Deartment_locations(d-number, d-location)
Project(p-name, p-number, p-location, D-no)
Works_on(employee-SSN, project-no, hours)
Dependent (employee-SSN, dependent-name, sex, birth-date, relationship)
And the question is:
Write a PL/SQL program to calculate the yearly bonus that the company gives to its employees. The company determines the bonus amount by considering four factors: (1) how many years the employees has worked at the company, (2) the employeeâs job type, (3) how many projects the employee has worked on, and (4) how many dependents the employee has.
â¢If an employee has worked at the company from 2 â 5 years, then he/she receives a $200 bonus; 6 â 10 years merits a $500 bonus; and over 10 years merits a $1000 bonus.
â¢For job type, managers receive an additional $300 bonus.
â¢If an employee has worked on one project, then he/she receives a $100 bonus; two projects merits a $150 bonus; and over 2 projects merits a $200 bonus.
â¢Finally, if an employee has one dependent, then he/she receives a $1000 benefit; two dependents receives a $1500 benefit; and more than two dependents receives a $2000 benefit.
Display the calculated bonus for each employee.
Any help would be greatly appreciated!