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
What is called query processing? Query processing refers to the range of activities included in extracting data from a database.

What is an entity relationship model? The entity relationship model is a set of basic objects known as entities and relationship between those objects. An entity is a thing or

What are the advantages of Logical Databases? It offers a simple-to-use selection screens.  You can change the pre-generated selection screen to your needs.  It offers check f

Prepare Heart Failure Registry database How are you today? Please I would like you to design a Heart Failure registry where doctors will log in to enter information about their

Write a Query that uses the UNION Operator 1. Use the Software Experts database to:   a. Display the first and the last name of all consultants who worked on any projects f

When is a transaction rolled back? Any changes that the aborted transaction made to the database must be uncompleted. While the changes caused by an aborted transaction have be

Atomicity : Either all functions are laid out or none are. Users could not have to think about the effect of incomplete operations. DBMS ensures this by undoing the functions

What is a security? Securities are claims on financial assets.  They can be illustrated as "claim checks" which give their owners the right to receive funds in the future.  Sec

In an E-R diagram an entity set is represent by? In an E-R digram entity set is represted by rectangle.

differences between a classified catalog and a dictionary catalog