There is a table with emp salary column how to get the fields belongs to the salary greater than the average salary of particular department.
Write a query

Answers were Sorted based on User's Feedback



There is a table with emp salary column how to get the fields belongs to the salary greater than the..

Answer / ram

SELECT * FROM emp e WHERE sal > (SELECT AVG(sal) FROM emp m
WHERE e.deptno = m.deptno GROUP BY deptno) ORDER BY deptno

gives u salary greater than the average salary of their
departments...

Is This Answer Correct ?    22 Yes 4 No

There is a table with emp salary column how to get the fields belongs to the salary greater than the..

Answer / murali krishna udayagiri

SELECT E.* FROM EMP E ,(SELECT DEPTNO,AVG(SAL) AVGSAL FROM
EMP GROUP BY DEPTNO) E1
WHERE E.SAL>E1.AVGSAL
AND E.DENPTNO=E1.DEPTNO;

Thanks,
Murali Udayagiri

Is This Answer Correct ?    6 Yes 2 No

There is a table with emp salary column how to get the fields belongs to the salary greater than the..

Answer / manoj

SELECT *FROM EMP WHERE SAL>(SELECT AVG(SAL) FROM EMP WHERE
DEPTNO=10);
this is correct answer. all the above answer are wrong except last one. Because in single row sub query we can't use group by clause. In all above queries they were used '>' simbol. So this is single row sub query matching operator.

Is This Answer Correct ?    3 Yes 0 No

There is a table with emp salary column how to get the fields belongs to the salary greater than the..

Answer / sameer

Select * from emplyees
Where sal>(select avg ( sal) from emplyees )
No need to write complex queries

Is This Answer Correct ?    2 Yes 1 No

There is a table with emp salary column how to get the fields belongs to the salary greater than the..

Answer / vivek singh

SELECT * FROM EMP WHERE SAL>(SELECT AVG(SAL) FROM EMP)
AND DEPTNO=10;

O/P:
7839 KING PRESIDENT 17-NOV-81 5000 10
7782 CLARK MANAGER 7839 09-JUN-81 2450 10

Is This Answer Correct ?    0 Yes 0 No

There is a table with emp salary column how to get the fields belongs to the salary greater than the..

Answer / lokesh y g

select e.no,e.name,e.salary from emp e where salary >
(select avg(salary)as salary from emp e1 where e.no=e1.no
group by no)

Is This Answer Correct ?    1 Yes 3 No

There is a table with emp salary column how to get the fields belongs to the salary greater than the..

Answer / sri

SELECT *FROM EMP WHERE SAL>(SELECT AVG(SAL) FROM EMP WHERE
DEPTNO=10);

Is This Answer Correct ?    4 Yes 6 No

Post New Answer

More Informatica Interview Questions

can any one explain me about junk dimension

4 Answers  


performance wise which one is better in joiner and lookup transformation?why?explain clearly?

1 Answers   IBM,


how we can update a target table without update strategy and update override?

3 Answers   TCS,


how to work with mapplet designer in informatica?

7 Answers  


What is active and passive transformation?

10 Answers  






suppose i have source 101 a 101 b 101 c 101 d i want target like 101 abcd how will u achive this please give me the answer

5 Answers   ITC Infotech, TCS,


When you move from devel to prod how will you retain a variable

1 Answers  


How You Pull the records on daily basis into your ETL Server.

2 Answers   TCS,


tell me the push down optimization

2 Answers   Wipro,


performance wise which one is better in joiner and lookup transformation

2 Answers  


source is a flat file empname, empno, sal ram, 101, 1,000 sam, 102, 2,000 ques: my target needs the data to be loaded as sal -1000 and 2000 excluding commas target empname, empno, sal ram, 101, 1000 sam, 102, 2000 how to implement this?

5 Answers   Polaris,


How many input parameters can exist in an unconnected lookup?

0 Answers  


Categories