table name: prod there are three fields in the table that are
1.proddate
2.prodQty
3.model
Day wise prodQty is stored in the table prod
write a query to display total prodqty in the year 2004 april.

Answers were Sorted based on User's Feedback



table name: prod there are three fields in the table that are 1.proddate 2.prodQty 3.model Day..

Answer / ajit

SELECT SUM(PRODQTY) FROM EMP WHERE TO_CHAR(PRODDATE,'MON-YYYY')='APR-2014';

Is This Answer Correct ?    1 Yes 0 No

table name: prod there are three fields in the table that are 1.proddate 2.prodQty 3.model Day..

Answer / sunnil

select sum(prodqty) from emp where to_char('proddate','yyyy')=2014 and to_char('proddate','mm')=04;

Is This Answer Correct ?    1 Yes 1 No

Post New Answer

More SQL PLSQL Interview Questions

Hi Everyone, How to get fist and last record from a table in oracle? Thanks in advance

13 Answers   IBM,


How can we debug in PL/SQL?

0 Answers  


What is java sql driver?

0 Answers  


what is a cursor? : Sql dba

0 Answers  


What is varray in pl sql?

0 Answers  






declare v_count number(8,3); v_sal scott.emp.sal%type := '&P_sal'; cursor cur_name is select sal from scott.emp where sal between (v_sal-100) and (v_sal +1000); begin v_count :=nvl(sql%rowcount ,0); if v_count = 0 then dbms_output.put_line('no records are fetch in the given sal range'); else dbms_output.put_line('There is/are '||to_char(v_count)|| ' salaries are selected in the given range '); end if; end; in the above programm .....for any sal range ....always it shows the following message.. no records are fetch in the given sal range please find the mistake and share with me...with thansk and regards..sarao....

3 Answers   Satyam,


What does pl sql developer do?

0 Answers  


Why is sql better than hql?

0 Answers  


How many tables can you join in sql?

0 Answers  


What are all the different normalization?

0 Answers  


Is primary key is clustered index?

0 Answers  


What will be the output of this Query? select to_char(trunc(add_months(sysdate-3),mm),mm/dd/yyyy) from dual

6 Answers   Cap Gemini, TCS,


Categories