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

Northwind Pty Ltd sells a variety of food products throughout the world. They want to use the reporting features of SAP''s Business Information Warehouse to better understand thei

Class Diagram A class diagram is required to support functional necessity of system. In a static design view, class diagram is used to model vocabulary of the system, simple c

Object-based Models: Use objects as key data representation components . Examples:-   Entity-Relationship Model: It is a collection of real world objects known as entitie

give some example real-life situations where DBMS are most suiitabe

what is the importance of back up files

What is deadlock? Neither of the transaction can ever proceed with its normal implementation. This situation is known as deadlock.

Demonstrate the Design of associations During object design phase we must design a strategy to implement associations. Association may be unidirectional or bi-directional. Wha

What is serialization? Where it is used and why?  Serialization is a basic term used for mechanisms which enable objects and object structures to be converted into portable for

A domain is a set of permissible values that can be given to an attribute. So each attribute in a table has a definite domain. Values to these attributes cannot be assigned outside