Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

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

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

Step by Step Solution

There are 3 Steps involved in it

Step: 1

Here are some possible answers to your questions but you should try to understand the logic and syntax behind them You can also refer to some online t... blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Concepts of Database Management

Authors: Philip J. Pratt, Mary Z. Last

8th edition

1285427106, 978-1285427102

More Books

Students also viewed these Databases questions

Question

understand the selection bias in contemporary work psychology;

Answered: 1 week ago

Question

Explain the various methods of job evaluation

Answered: 1 week ago

Question

Differentiate Personnel Management and Human Resource Management

Answered: 1 week ago

Question

Describe the functions of Human resource management

Answered: 1 week ago

Question

Copy and complete the statement. 3800 m ? km =

Answered: 1 week ago

Question

What is redundancy? What problems are associated with redundancy?

Answered: 1 week ago

Question

How do you create a one-to-many relationship in a database system?

Answered: 1 week ago