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

Mention the purpose of SID and SOD lines SID (Serial input data line): It is an input line by which the microprocessor accepts serial data. SOD (Serial output data line)

Which is a legal expression in SQL? SELECT NAME FROM EMPLOYEE is a legal expression in SQL.

A Relation Schema represented by R(A1, A2, ..., An) is made up of the relation name the list of attributes and R Ai that it contains. A relation is described as a set of tuples

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

Law Associates is a large legal practice based in Sydney. You have been asked to design a data model for the practice based upon the following specification: The practice employs

explain concept of decomposition?

Spanned and unspanned organisation? Spanned and unspanned organization: If records are not permited to cross block boundaries then the organisation is called unspanned record

Evaluate, compare and contrast the two methods of relational database design namely top down method and Bottom up method. What will be your choice if you are asked to select a meth

Define Aggregate functions and what aggregate functions supported by the MySQL To calculate a summary value from a set of individual values and uses one of the functions known