write a query to find out the no. of employees whose age is
less than 25 and max of salary for the employees belonging
to a particular department is less than 20000

Answer Posted / pradeep

There is little mistake in Nitin the MONTHS_BETWEEN
(SYSDATE,hiredate)should be stated like this because if we
place hiredate firt the output comes in Negative, so it
gives all record.

select DEPTno,COUNT(EMPno),max(SAL)
from EMP
where (TO_CHAR(sysdate,'yyyy') - TO_CHAR(HIREDATE,'yyyy'))
< 25
GROUP BY DEPTno
having max(sal) < 20000

Is This Answer Correct ?    1 Yes 2 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

Explian rowid, rownum? What are the psoducolumns we have?

668


What do we need to check in database testing?

646


How do you sort in sql?

692


What are the different types of dbmss?

648


What is database migration?

604






what are the properties and different types of sub-queries? : Sql dba

609


how can we find the number of rows in a table using mysql? : Sql dba

682


Can we rollback after truncate?

660


how would you enter characters as hex numbers? : Sql dba

613


What is a call statement? Explain with an example.

644


What does the file extension accdb stand for?

637


What is clustered index in sql?

675


What are the three pl sql block types?

651


How do you declare a variable in pl sql?

632


What is the reports view in oracle sql developer?

648