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

How does cross join work?

1009


What is the difference between cluster and non-cluster index?

1160


write an sql query to find names of employee start with 'a'? : Sql dba

1089


What are expressions?

1062


What sql database should I use?

1202


What is sql stand for?

1033


Why do we use cursors?

1046


What is a data manipulation language?

1078


Does user triggers have entry for trigger with compilation errors?

1091


What does select * from mean in sql?

3337


Why is theta join required?

1189


How do I run a program in pl sql?

1056


Which normal form is best?

999


What is sqlservr exe?

1029


explain the options of myisamchk to improve the performance of a table. : Sql dba

1075