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
Boyce-Code Normal Form (BCNF) A relationship is said to be in BCNF if it is already in 3NF and the left hand side of each dependency is a candidate key. A relation who is in 3N

Consider the subsequent relations along with keys underlined Street (name, location, city) House (number, street_name) Lives (name, house_number) Define the above relations

folding method and mid square method using visual basic

Project Description: I am having a random problem with my Wordpress site. If I click on "Publish" and "Add new", it takes me to a 404 page not found of /wp-admin/post.php (th



Can a filed occur in several field groups. Yes.  But it leads to redundant data redundancy.

Suppose R is a relation with attributes A1, A2,..., An. As a function of n, tell how many superkeys R has, if: 1.1 The only key is A1. 1.2 The only key is A1 and A2. 1.3 The o

Explain Instance and schemas? Instances and schemas: Databases changes over time as the information is deleted and inserted. The collection of information stored in database

Give some encryption techniques? A)  DES  B) AES  C) Public key encryption