Golgappa.net | Golgappa.org | BagIndia.net | BodyIndia.Com | CabIndia.net | CarsBikes.net | CarsBikes.org | CashIndia.net | ConsumerIndia.net | CookingIndia.net | DataIndia.net | DealIndia.net | EmailIndia.net | FirstTablet.com | FirstTourist.com | ForsaleIndia.net | IndiaBody.Com | IndiaCab.net | IndiaCash.net | IndiaModel.net | KidForum.net | OfficeIndia.net | PaysIndia.com | RestaurantIndia.net | RestaurantsIndia.net | SaleForum.net | SellForum.net | SoldIndia.com | StarIndia.net | TomatoCab.com | TomatoCabs.com | TownIndia.com
Interested to Buy Any Domain ? << Click Here >> for more details...


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

Answers were Sorted based on User's Feedback



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

Answer / rajesh venati

CREATE OR REPLACE PROCEDURE PRO
IS
CURSOR ECUR IS SELECT TO_CHAR(HIREDATE,'MON')
V_MONTH,COUNT(*) V_NO FROM EMP GROUP BY TO_CHAR(HIREDATE,'MON');
BEGIN
FOR V_ECUR IN ECUR LOOP
DBMS_OUTPUT.PUT_LINE(V_ECUR.V_MONTH||' '||V_ECUR.V_NO);
END LOOP;
END;


SQL> EXEC PRO;
DEC 3
APR 2
NOV 1
SEP 2
FEB 2
JUN 1
MAY 2
JAN 1

Is This Answer Correct ?    15 Yes 3 No

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

Answer / 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

More SQL PLSQL Interview Questions

What schema means?

0 Answers  


Can we use joins in subquery?

0 Answers  


what are the advantages of using stored procedures? : Sql dba

0 Answers  


Explain how procedures and functions are called in a PL/SQL block ?

3 Answers  


What is sql in oracle?

0 Answers  


Do we need commit after truncate?

0 Answers  


i want insert 10 records from table a to table b. if i m using statement level trigger how many record insert ?in row level trigger how many record inserted???

3 Answers   Scope International,


What are wait events. Describe the wait event tables.

1 Answers   CTS,


Is merge a dml statement?

0 Answers  


Do you understand the meaning of exception handling?

3 Answers  


How to display all Friday's in a year with date?

4 Answers   Flipkart,


What is auto increment in sql?

0 Answers  


Categories