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
How does cross join work?
What is the difference between cluster and non-cluster index?
write an sql query to find names of employee start with 'a'? : Sql dba
What are expressions?
What sql database should I use?
What is sql stand for?
Why do we use cursors?
What is a data manipulation language?
Does user triggers have entry for trigger with compilation errors?
What does select * from mean in sql?
Why is theta join required?
How do I run a program in pl sql?
Which normal form is best?
What is sqlservr exe?
explain the options of myisamchk to improve the performance of a table. : Sql dba