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
Explain how you can define an object model of a system. A list of terms that shall be used by end users to describe state and behaviour of objects in system.   Different use

Problem 1. Write the SQL queries using Data Manipulation Language (DML) statements. Insert values into student table with field names using insert command Display the

Your friend owns a computer store in Yuen Long, selling Desktop and Notebook PCs and other computer peripherals. Having been rather successful with his business there, he decided t

Differentiate between static hashing and dynamic hashing.  Ans: Static Hashing comprises the number of primary pages in the directory fixed. So, while a bucket is full, we requ

Determine the OBJECTIVES of  object design After passing through this unit, you should be able to: describe and apply concept of generalisation; understand and appl

What are the advantages of object oriented databases in comparison with others? Why it is still not widely used? Object oriented designs are coherent, efficient and less prone

Explain the Aggregation implies concurrency Concurrency actually is: This in objects can be identified by the way they change state. Present objects can change state independen

Package classes and associations into models  Programs are made of separate physical units which could be edited, imported, complied or otherwise manipulated. The careful part

1 NF Normal Form The domain of attribute must add only atomic (simple, indivisible) values First normal form (Minimal Form or 1NF) is a normal form need in database normalizat

Security And Integrity After Reading the concepts of database recovery in the last section, let us now deal with a vital concept that helps in minimizing consistency errors in