PL/SQL Cursor Exercises: Display the first department with more than five employees
PL/SQL Cursor: Exercise-46 with Solution
Write a block in PL/SQL to display the first department with more than five employees.
Sample Solution:
Table: employees
employee_id integer first_name varchar(25) last_name varchar(25) email archar(25) phone_number varchar(15) hire_date date job_id varchar(25) salary integer commission_pct decimal(5,2) manager_id integer department_id integer
Table: departments
department_id integer department_name varchar(25) manager_id integer location_id integer
PL/SQL Code:
Sample Output:
SQL> / Department ID Department Manager No. of Employees ----------------------------------------------------------------------------- 30 Purchasing Den Raphaely 6 PL/SQL procedure successfully completed.
Flowchart:

Improve this sample solution and post your code through Disqus
Previous: Write a block in PL/SQL to print a dotted line in every 6th line.
Next: Write a block in PL/SQL to print a report which shows that, the employee id, name, hire date, and the incentive amount they achieved according to their working experiences, who joined in the month of current date.
What is the difficulty level of this exercise?