Write a PL/SQL Program to display the department number, department name, location and number of employees. The department which is having more than three employees.

0
Write a PL/SQL Program to display the department number, department name, location and number of employees. The department which is having more than three employees.
    
SQL>DECLARE
    CURSOR cs is
    SELECT d.deptno,d.dname,d.loc,v.noe
    FROM dept d,(SELECT deptno,count(*) noe
            FROM emp
    Group by deptno) v
    WHERE  v.noe>3 AND
    d.deptno=v.deptno;
    BEGIN
    FOR  i in cs
    LOOP
  display(i.deptno||’ ‘||i.dname||’ ‘||i.loc||’ ‘||i.noe);
    END LOOP;
    END; 

 Click here to go to Back page

About the author

Donec non enim in turpis pulvinar facilisis. Ut felis. Praesent dapibus, neque id cursus faucibus. Aenean fermentum, eget tincidunt.

0 comments:

Recent Posts