Question: Write a PL / SQL function COUNT _ EMP _ NN ( NN is your initials ) to return the number of employees working in

Write a PL/SQL function COUNT_EMP_NN (NN is your initials) to return the number of employees working in a given country. The input parameter is a string (COUNTRY_ID).
Hint: the following query returns information on 106 employees (1 employee is not assigned to a department; therefore, is not included in the INNER query).
select e.employee_id, e.department_id, d.department_name,l.*
from (hr.employees e join hr.departments d on e.department_id = d.department_id) join hr.locations l on d.location_id = l.location_id;In your answer include:
1. CREATE statement for the function.
2. SELECT statement (USER_OBJECTS) to list information about your function (OBJECT_NAME, OBJECT_TYPE, CREATED showing day and time, STATUS) and the results
3. Test results for US, CA, UK and XX (invalid country id). Query + results

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!