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
The Database Approach In order to overcome the limits of a file system, a new approach was needed. Hence a database approach emerged. A database is a persistent collection of

The PROJECT operation The project operation is used to choose the records with specified attributes as discarding the others based on some related criteria. This is denotes as ∏

What is System R? What are its two major subsystems? System R was intended and developed over a period of 1974-79 at IBM San Jose Research Center. It is a prototype and its pur

A practice called Perfect Pets provides private health care for domestic pets throughout America. This service is provided through various clinics located in the main cities of Ame

Define the terms i) Key attribute ii) Value set Key attribute: An entity type usually has an attribute whose values are exact from each individual entity in the collection. Su

What is a state chart diagram? State diagrams (State Chart Diagram) explain all possible states that a particular object can get into, and how object's state changes as result

Explain ODBC? ODBC - Open DataBase Connectivity (ODBC) enable the integration of SQL along with a general-reasons programming language.

#ques Define a job scheduling strategy that will meet business requirement of reporting availability by 6am CST for the following cubes? Show the job scheduling dependencies in a p

Multi-Key File Organisation In this part, we will introduce two basic file Organisation schemes that permit records to be accessed by more than one key field, therefore, allowi

what is cascading? what is rollback cascading? please explain in detail