Write a procedure to return the month and the number of
developers joined in each month (cursor )

Answer Posted / prabhudatta barick

CREATE OR REPALCE PROCEDURE EMP_PRO
IS
BEGIN

FOR EMP_CUR IN(SELECT SUBSTR(EMP_DOA,4,3) MONTH,
COUNT(*) NO_OF_EMP
FROM HRD_EMPLOYEETB
GROUP BY SUBSTR(EMP_DOA,4,3)
ORDER BY 1)
LOOP

DBMS_OUTPUT.PUT_LINE(EMP_CUR.MONTH||' '||EMP_CUR.NO_OF_EMP);


END LOOP;

END;

Is This Answer Correct ?    0 Yes 0 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

Why is theta join required?

664


How do I save a sql query?

542


What are the types of dbms?

545


What programs use sql?

526


How many types of keys are there in sql?

554






What is the difference between count 1 and count (*) in a sql query?

498


What is the usage of when clause in trigger?

566


How do rank () and dense_rank () differ?

520


what are tables and fields? : Sql dba

579


How do you explain an index?

787


How do I save a stored procedure?

525


What is left join in sql?

583


How do you modify a column in sql?

535


What does where 1 1 mean in sql?

544


How do you identify a primary key?

627