Search the salary of employees who are not ‘analyst’ , Database Management System

Example-Search the salary of employees who are not 'ANALYST' but get a salary below than or equal to any people employed as 'ANALYST'.

SELECT EMPNO, ENAME, JOB, SAL

FROMEMP

WHERE SAL <= ANY (SELECT SAL

                                     FROM EMP WHERE JOB = 'ANALYST')

            AND JOB<>'ANALYST' ;

 

EMPNO

ENAME

JOB

SAL

DEPTNO

7566

Nirmal

MANAGER

2975

10

7788

Kailash

ANALYST

3000

10

7839

Karuna

PRESIDENT

5000

20

7902

Ashwin

ANALYST

3000

20

7905

Ashwini

MANAGER

4000

20

OUTPUT:

EMPNO

ENAME

JOB

SAL

7566

Nirmal

MANAGER

2975

 

Search the average salary in every department

SELECT DEPTNO, AVG(SAL) FROM EMP GROUP BY DEPTNO;

Result:

 

DEPTNO

SAL

10

2987.5

20

4000

 

Posted Date: 3/11/2013 3:57:11 AM | Location : United States







Related Discussions:- Search the salary of employees who are not ‘analyst’ , Assignment Help, Ask Question on Search the salary of employees who are not ‘analyst’ , Get Answer, Expert's Help, Search the salary of employees who are not ‘analyst’ Discussions

Write discussion on Search the salary of employees who are not ‘analyst’
Your posts are moderated
Related Questions
#question benefits and limitations of data models..

Question: A DBMS built for Online Transaction Processing (OLTP) is generally regarded as unsuitable for data warehousing. Each system is designed with a different set of requir

What are the problems if one were not to normalize?  When do these problems surface?           Ans:  Database normalization, sometimes considered to as  canonical synthesis, is

Consider the entity type dependent related to employee entity, which is used to keep track of the dependents of every employee. The attributes of dependents are: name, sex, birth d

The Incident table, with an auto-incrementing incident number, etc, looks like: incident_num reporter date time incide

In order to keep pace with competitors, Space Ltd has decided to implement an ERP system in order to replace its old legacy and manual systems. Management does not have much knowle

Let consider the given partial relation EMP. Let us make some sub-queries for them EMPNO ENAME JOB SAL DEPTNO 7566

What is transaction? Transaction is a unit of program implementation that accesses and possibly updated several data items.


Explain the Fundamental concepts of object-orientation Software developers, data base administrators (DBAs) need to be familiar with fundamental concepts of object-orientation.