i have a table
eno dno sal
1 10 200
2 10 150
3 10 100
4 20 75
5 20 100

i want to get sal which is less than the avg sal of thri dept.

eno dno sal
2 10 150
3 10 100
4 20 75

Answers were Sorted based on User's Feedback



i have a table eno dno sal 1 10 200 2 10 150 3 10 100 4 20 75 5 20 100 ..

Answer / parth

select salary from eno where salary<(select avg(salary)
from eno ) and rownum < 6

Is This Answer Correct ?    0 Yes 3 No

i have a table eno dno sal 1 10 200 2 10 150 3 10 100 4 20 75 5 20 100 ..

Answer / vin

select * from emp group by deptno having sal < avg(sal)

Is This Answer Correct ?    0 Yes 3 No

Post New Answer

More SQL PLSQL Interview Questions

suppose I have two table one Emp and other is dpt. Emp table has a field ,dept id,name ,sal and dpt table has a field dept id,dept name. Now I want to find out the emplyee list whose sal is between 2000-3000 from dept x.

7 Answers   Geometric Software, IBM,


What is hibernate and its relation to sql?

0 Answers  


Is microsoft sql free?

0 Answers  


If i insert record in table A and these record should update in table B by using Trigger.How to achieve this.

4 Answers   Saama Tech, TCS,


What is Referential Integrity?

3 Answers  






What is native sql query?

0 Answers  


what is difference between decode and case function?

2 Answers  


what is the difference between union and union all? : Sql dba

0 Answers  


How do you determine the current isolation level? : Transact sql

0 Answers  


What is materialised View?

2 Answers   IBM,


What is the difference between left join and left outer join?

1 Answers  


What are the types of keys?

0 Answers  


Categories