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
What do you understand by pl/sql packages?
What is the purpose of primary key?
what is single byte over head in oracle..?
How to look at the current sql*plus system settings?
What is $$ in sql?
Is like operator in sql case sensitive?
How can you view the errors encountered in a trigger?
what is user defined functions? : Sql dba
What are the 3 types of behavioral triggers?
What are the set operators in sql?
Is sql better than access?
Explain how exception handling is done in advance pl/sql?
What is a record in pl/sql?
Is oracle sql free?
Why select is used in sql?