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
Two-way Associations Mostly, associations are travel in both directions, although not usually with same frequency. There are three approaches for the implementation. In

What is Structured Query Langauge (SQL)? SQL is a powerful set-oriented language which was formed by IBM research for the databases that adhere to the relational model. It havi

What are the comparison operator in SQL?  Comparison operator in SQL are =, LIKE and BETWEEN

Explain concurrency control? Concurrency control Oracles multiversion concurrency control varies from the concurrency mechanism used by some other data base vendors. Read

Write the motivations led to development of OO-DBMS? 1.  Programmer frustration with RDBMSs. 2.  Requirement for special features.

(a) Data Mining Process : In the context of this cluster analysis project , and in your own words , explain how you would execute the first stage of data mining, namely the "P

Explain differance between Primary and secondary storage ? Primary and secondary storage Computer storage is classified within primary(main) memory and secondary(per

What are the two main goals of parallelism? Load -balance multiple small accesses, so that the  throughput of such accesses enhances. Parallelize large accesses so that the res

Determine the minimal set of functional dependencies for the following data. This table is part of the OHSU database of extracurricular activities and tracks the DMICE band's co

Describe the Composite Key Composite Key: Sometimes one key is not enough to uniquely recognize a row. E.g. in a single class Roll is enough to search a student, but in the w