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

Answer Posted / rutujagabhane

select salary from emp
wher dno in (select dno
from dept
where salary < any
(select avg(salary)
from dept
where dept = 3)

Is This Answer Correct ?    0 Yes 0 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

Can you join views in sql?

556


Is it possible for a table to have more than one foreign key?

589


Does sql view stored data?

546


Where is all the data on the internet stored?

566


What is normalization in a database?

622






Why we use triggers in mysql?

566


How do you concatenate in sql?

561


What are % type and % rowtype?

584


What are tuples in sql?

575


What is cascade in sql?

567


Is sql open source?

553


Define select, insert, create, delete, update, drop keywords

606


What is the purpose of cursors in pl/sql?

650


What are the benefits of pl sql?

540


How to sort the rows in sql.

616