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

What is deployemnt groups, Lables, query and dynamic deployment group.

1 Answers   IBM, SVP,


Define Pmrep command?

0 Answers  


What is a joiner transformation and why it is an active one?

0 Answers  


What is the difference between view and materialised view?

6 Answers  


What happens when a session fails and you click on recover?

0 Answers  






Do you find any difficulty while working with flat files as source and target?

0 Answers  


What are active transformations.

0 Answers  


If a session fails after loading of 10,000 records in to the target.How can you load the records from 10001?

5 Answers   TCS,


suppose we will take flatfile target and load type is bulkload the session fails why please give me the answer

1 Answers   TCS,


following scenario i have 1000 record flatfile source i want ist row to ist target 2nd eow to 2nd target 3rd row to 3rd target how will u do?

7 Answers   Polaris,


what is unique constraint error ?

2 Answers   TCS,


Can we use Union Transformation for Heterogeneous sources? i.e; 3 sources, 1 from Oracle, 2nd from Informix, 3rd from Sql Server with same metadata?

3 Answers   TCS,


Categories