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

Answers were Sorted based on User's Feedback



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

Answer / khushbu patel

select dept,count(emp),max(sal)
from a
where age < 25
group by dept
having max(sal) < 20000

Is This Answer Correct ?    11 Yes 2 No

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

Answer / vikneswaran thangarasu

Ignore my previous post. it is wrong.

select dept,count(emp),max(sal) from employee where age <25
group by dept having max(sal) <20000

Is This Answer Correct ?    3 Yes 0 No

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

Answer / priya

select dept,count(emp) from employee where age <25 and max
(sal) <20000 group by dept.

Is This Answer Correct ?    4 Yes 4 No

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

Answer / vikneswaran thangarasu

select dept,count(emp),max(sal) from employee where age <25
and sal <20000 group by dept

Is This Answer Correct ?    1 Yes 1 No

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

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

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

Answer / nitin umale

SELECT department_id, COUNT(employee_id), MAX(salary)
FROM employees
WHERE MONTHS_BETWEEN(hire_date, SYSDATE) < 25*12
GROUP BY department_id
HAVING MAX(salary) < 20000;

Is This Answer Correct ?    3 Yes 6 No

Post New Answer

More SQL PLSQL Interview Questions

How to disable a trigger name update_salary?

0 Answers  


How do you concatenate in sql?

0 Answers  


explain the difference between myisam static and myisam dynamic. : Sql dba

0 Answers  


trans_id trans_date trans_amt debit_credit_indicator 001 01-JAN-13 1099 cr 001 12-JAN-13 500 db 002 24-FEB-13 400 db 002 23-MAR-13 345 cr 001 18-APR-13 800 cr 002 15-MAR-13 600 db 001 12-FEB-13 200 cr i want like this output trans_id trans_date trans_amt debit_credit_indicator 001 JAN 1599 cr no.of trans 2 i want trans_id and trans_date like 'JAN' or 'FEB' etc, trans_amt i want all credit amount - debit amount per each trans_id. and debit_credit_indicator and no.of transactions in a month.

1 Answers   Oracle,


Types of joins ?

11 Answers   Polaris, TCS,


how many values can the set function of mysql take? : Sql dba

0 Answers  


What is triggering circuit?

0 Answers  


What are properties of the transaction?

0 Answers  


Explain correlated query work?

0 Answers  


Does sql use python?

0 Answers  


What are the syntax and use of the coalesce function?

0 Answers  


Explain what is an index?

0 Answers  


Categories