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 a recursive relationship? Give an example not used in the text. A recursive relationship is a relationship among an entity and itself. For example, given the entity PER

These are designed to reduce the effects of a database failure and make sure a database is restored to a consistent state if a failure does arise. Manual backup/restore utilities n

Define value set? Value set: It is a set of values. You do not always need a user to enter junk free text within all the fields. Therefore, Oracle Apps uses value set to valida

What is Asterisk in SQL? Asterisk (*): In SQL, the columns for all the tables and views in the FROM clause will be displayed.

Concurrency issues Data integrity: Threads accessing same object need to be synchronized, such as: banking account. Deadlock: One or more threads in system are perman

User error :  This contains errors in the program (e.g., Logical errors) with errors made by online users of database.  These types of errors can be avoided by applying some check

How to draw an ER diagram to a finance companz

Question: (a) Discuss the difference between a composite key and a composite attribute. How would each be indicated in an E-R diagram? Support your answer with appropriate exam

Define blocks? The database system resides eternally on non-volatile storage, and is into fixed-length storage units known as blocks.

What is a Transaction? A transaction is an event which happens on the database. Generally a transaction reads a value from the database or writes a value to the database. If y