Answered step by step
Verified Expert Solution
Question
1 Approved Answer
Write short programs as requested, the outputs of the program are required to be attached in your submission. Q 1 , ( 1 5 points
Write short programs as requested, the outputs of the program are required to be attached in your submission.
Q points A standalone procedure, based on Employees Table.
In this question, you will create a standalone Procedure called Calcbonus. This procedure will Get an employee's ID then calculate the bonus according to the policy below. It should claim one IN parameter you give it a name its data type is same as employeeid number and one OUT mode parameter you give it a name that is the bonus calculated based on the policy.
For employees that their salaries are $ or more, bonus is $
For employees that their salaries are $ or more but less than $ bonus is $
For employees that their salaries are $ or more but less than $ bonus is $
All other employees will get $
After having successfully compiled the procedure, write an anonymous PLSQL program. It will call this procedure Calcbonus for each employee in department and The program will print out each employee's ID salary, and the bonus.
Also, your program will print out the total bonus for this department and
Q points Write a PLSQL block program, based on Locations and Departments table.
In this question you will define a userdefined record type, then define a nested table data type using this record type as its element. The detailed requirements are as below.
Define a userdefined record type called DeptLoc has two fields in it:
DNo: correspondent to departmentid in the Departments table
DLoc: this will be the concatenation of streetaddress, a comma and a space then the city name from the Locations table.
After having defined this record type, your program will declare a nested table data type called DeptLocList that use this record type as its element. You should declare a variable of this nested table data type, you give it a name.
Your program will retrieve the data from Departments and Locations tables for all the departments that have a department manager assigned. Populate this nested table variable with the retrieved data, print out the contents of it: the department ID's and the location strings for each department. Please make the output order by the department ID
In this question, you are required to use cursor for loop.
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started