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

What is the best free sql database?

0 Answers  


How can multiply values of a column? OR How can multiply value of a row of a column using a single query in SQL?

1 Answers   Pitney Bowes,


How do I use google cloud in sql?

0 Answers  


what is an execution plan? When would you use it? How would you view the execution plan? : Sql dba

0 Answers  


How many LONG columns are allowed in a table?

6 Answers   CTS,






What is primary key and foreign key?

0 Answers  


How can you save or place your msg in a table?

0 Answers  


types of exceptions and what is meant by pragma autonomous_transaction ?what is the use.

4 Answers   3i Infotech,


What is nosql vs sql?

0 Answers  


Can we update views in sql?

0 Answers  


What is a database event trigger?

0 Answers  


How do I view tables in sql developer?

0 Answers  


Categories