Homework Assignment: PL/SQL

You know how to do loops and you know how to do cursors. This assignment should use both as appropriate. You should not use any user input.

First Problem:Write a PL/SQL program to accomplish the following: Using the sample emp database, give everyone in dept 10 a 5% raise, everyone in dept 20 a 7.5% raise, everyone in department dept 30 a 10% raise. Do this using a simple IF...ELSE and a loop.

Second Problem:Modify the program above to use a IF...ELSIF.

Third Problem:Modify the problem in #1 to meet the following criteria:
IF dept is 10 and the salary is greater than 2000 give a 6% raise otherwise give a 7% raise. IF dept is 20 and the salary is greater than 2500 give a 5% raise otherwise give a 5.5% raise. IF dept is 30 and the salary is greater than 1000 give a 7% raise otherwise give a 6.5% raise.

Fourth Problem:Write a PL/SQL program to accomplish the following using two loops and two cursors:
The payroll tables that you created for the keys assignment should have a projects table and an table that contains the hours each employee put in on the project. You want to step through each project and accumulate the number of hours that were spent on that project totally. You need to do this using one cursor for the project table and one cursor for the employee hours information.