query to retrive the employees whose sal is greater than avg
sal

Answers were Sorted based on User's Feedback



query to retrive the employees whose sal is greater than avg sal..

Answer / gop

SELECT sal FROM EMPLOYEES WHERE sal>(SELECT avg(sal) FROM
EMPLOYEES);

Is This Answer Correct ?    47 Yes 6 No

query to retrive the employees whose sal is greater than avg sal..

Answer / shiva

select e.* from emp e where e.sal>(select avg(sal) from emp);

Is This Answer Correct ?    6 Yes 3 No

query to retrive the employees whose sal is greater than avg sal..

Answer / gourav

select salary,AVG_SALARY from z1
where salary>AVG_SALARY

Is This Answer Correct ?    4 Yes 1 No

query to retrive the employees whose sal is greater than avg sal..

Answer / swapna

select ename from emp where sal>(select avg(sal) from emp);

Is This Answer Correct ?    4 Yes 2 No

query to retrive the employees whose sal is greater than avg sal..

Answer / damy

select salary from table_name where salary >=(select avg(salary) from table_name)

Is This Answer Correct ?    3 Yes 1 No

query to retrive the employees whose sal is greater than avg sal..

Answer / badchip

select ename,esal from emp_mast where esal > (select avg
(esal) from emp_mast group by esal);

Is This Answer Correct ?    3 Yes 2 No

query to retrive the employees whose sal is greater than avg sal..

Answer / amit

SQL>SELECT ENAME,SAL FROM EMP
WHERE SAL>(SELECT AVG(SAL) FROM EMP);

Is This Answer Correct ?    3 Yes 3 No

query to retrive the employees whose sal is greater than avg sal..

Answer / swastik

SELECT Sal 
FROM Emp
WHERE Sal >
          (
           SELECT AVG(Sal)
            FROM Emp
          );

Is This Answer Correct ?    0 Yes 0 No

query to retrive the employees whose sal is greater than avg sal..

Answer / musthafa

SELECT EMP_NO,EMP_SAL
FROM EMP_TAB
WHERE EMP_NO=&EMP_NUM
GROUP BY EMP_NO
HAVING EMP_SAL > AVG(EMP_SAL)

Is This Answer Correct ?    0 Yes 1 No

query to retrive the employees whose sal is greater than avg sal..

Answer / viren

since we are using aggregate function AVG, we have to use
GROUP BY, HAVING clause.

select empName, avg(sal) from employees group by sal having
sal > avg(sal) order by empName;

Is This Answer Correct ?    4 Yes 12 No

Post New Answer

More SQL PLSQL Interview Questions

How many types of triggers are there in pl sql?

0 Answers  


Is oracle sql free?

0 Answers  


Why do we use view in sql?

0 Answers  


How will you delete a particular row from a Table?

7 Answers   Cap Gemini,


What is sql entity?

0 Answers  






What is the difference between unique and primary key constraints?

0 Answers  


how to insert values like 10:10:00,30:25:00 etc.into table after insert how can i sum the above insert values to get the result as 40:35:00

3 Answers  


In table three columns with 1 milion records(here there is no sequence values) i want add one more column with sequence values from the first how it is posible?

4 Answers   Tech Soft,


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

0 Answers  


How to get second highest salary from a table

3 Answers  


suppose we have a table in which 200 rows. i want to find 101 row ? what the query.... and how we find 4th and 5th highest salary and 1 to 10 highest salary

7 Answers  


Why do we need databases?

0 Answers  


Categories