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
Can a key be both primary and foreign?
What is the purpose of cursors in pl/sql?
How does stored procedure reduce network traffic?
What are different categories of sql commands?
Explain cursor types?
what are aggregate and scalar functions? : Sql dba
How delete a row in sql?
what does the t-sql command ident_current does? : Transact sql
What is sql clause?
What are the benefits of pl/sql packages?
Differentiate between syntax and runtime errors.
What is latest version of sql?
What is the function that is used to transfer a pl/sql table log to a database table?
Can we create foreign key without primary key?
How do you optimize a stored procedure in sql?