1 Create a PL/SQL block to declare a cursor EMP_CUR to select the employee name, salary and...
Question:
1 Create a PL/SQL block to declare a cursor EMP_CUR to select the employee name, salary and hiredate from emp table. Process each row from the cursor, and if the salary is greater than 4000 and the hiredate is greater than 01-FEB-1980 , display the employee name , salary and hiredate.
Question 2 The purpose of this practice is to show the usage of predefined exceptions. Write a PL/SQL block to select the name of the employee with a given salary value. a) In the declarative section, declare two variables: v_ename of type emp.ename and v_emp_sal of type emp.sal. Initialize the sal to 3000. b) In the executable section, retrieve the name of employees whose salaries are equal to the value in v_emp_sal c) If the salary entered does not return any rows, handle the exception with an appropriate exception handler. d) If the salary entered returns more than one row , handle the exception with an appropriate exception handler an e) Handle any other exception with an appropriate exception handler
Question 3 Create a stored procedure or function called GET_SERVICE_YRS to retrieve the total number of years of service for a specific employee using employee number. Add appropriate error handling to account for an individual employee number.
Tables: https://mega.nz/file/VetRUK6Y#ByXJic0ix_FWMijlP4-e0jqgB22jRiDaf6xjL_JMuDg
Concepts of Database Management
ISBN: 978-1285427102
8th edition
Authors: Philip J. Pratt, Mary Z. Last