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
State about the Tables- DBMS Data is stored in columns and rows (much like a spreadsheet -main difference is how data is organised). Every row in a table is known as a record

The Update Operations : Update operations are used for altering database values. The constraint violations faced by this operation are logically the similar as the problem faced

Table Handling  In RDBMS more than one table can be tackled at a time by using join operation. Join operation is a relational operation that causes 2 tables with a common domai

State the meaning of Object Representation  The term object representation means "to represent object with the help of objects model symbols". Implementing objects is too simp

Differentiate between a Global and a Local temporary table? - A local temporary table exists only for the duration of a connection or if defined inside a compound statement, fo

The aims of the project are: 1. To enable the students to undertake the detailed design of a specific plant or process 2. The design projects includes: process selection; und

Multiple-mode locks : It offers two locks: exclusive locks and shared locks. But why do we require these two locks? There are a lot of transactions in the database system that neve

What is aggregate function? Briefly describe it? Aggregate functions are functions that take a collection of values as input and return a one value. SQL offers 5 built-in aggre

Question: (a) What are the challenges in the development of Large Scale Distributed Real Systems? (b) What is backward engineering and forward engineering in a design packa

How to create values of structured type? Constructor functions are used to make values of structured types. A function with the similar name as a structured type is a construct