query to retrive the employees whose sal is greater than avg
sal
Answers were Sorted based on User's Feedback
Answer / gop
SELECT sal FROM EMPLOYEES WHERE sal>(SELECT avg(sal) FROM
EMPLOYEES);
| Is This Answer Correct ? | 47 Yes | 6 No |
Answer / shiva
select e.* from emp e where e.sal>(select avg(sal) from emp);
| Is This Answer Correct ? | 6 Yes | 3 No |
Answer / gourav
select salary,AVG_SALARY from z1
where salary>AVG_SALARY
| Is This Answer Correct ? | 4 Yes | 1 No |
Answer / swapna
select ename from emp where sal>(select avg(sal) from emp);
| Is This Answer Correct ? | 4 Yes | 2 No |
Answer / damy
select salary from table_name where salary >=(select avg(salary) from table_name)
| Is This Answer Correct ? | 3 Yes | 1 No |
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 |
Answer / amit
SQL>SELECT ENAME,SAL FROM EMP
WHERE SAL>(SELECT AVG(SAL) FROM EMP);
| Is This Answer Correct ? | 3 Yes | 3 No |
Answer / swastik
SELECT Sal
FROM Emp
WHERE Sal >
(
SELECT AVG(Sal)
FROM Emp
);
| Is This Answer Correct ? | 0 Yes | 0 No |
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 |
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 |
What are the two parts of design view?
Table 1: col1 Timestamp ---------------- 01-mar-2012 11:12:46 Table 2: col2 Timestamp -------------------- 01-mar-2012 11:12:10 01-mar-2012 11:11:23 Write a query to display a row with table2 col2 value less than tabl1 col1 value. Maximum timestamp value previous to table1 col1 value. Display a result as: Col1 col2 ----- ----- 01-mar-2012 11:12:46 01-mar-2012 11:12:10
Can we use joins in subquery?
What are the different types of dbms?
What is data definition language?
Explain mutating table error.
What is difference between sql and oracle?
what is sql optimization
how to retrieve only duplicate values in a table
Explain what is a database?
need to split a string into seperate values. eg. col1 col2 ---------- 100 - 'a,b,c' 200 - 'a,x,b,d,e' 300 - 'c' result: value count ------------- a - 2 b - 1 c - 2 etc.
What is the criteria while applying index to any column on any table.
Oracle (3259)
SQL Server (4518)
MS Access (429)
MySQL (1402)
Postgre (483)
Sybase (267)
DB Architecture (141)
DB Administration (291)
DB Development (113)
SQL PLSQL (3330)
MongoDB (502)
IBM Informix (50)
Neo4j (82)
InfluxDB (0)
Apache CouchDB (44)
Firebird (5)
Database Management (1411)
Databases AllOther (288)