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 storage manager?  A  storage  manager  is  a  program  module  that  gives  the  interface  between the Low level data  kept in a database and the application programs

Storage Of Database On Hard Disks At this point, it is worthwhile to note the difference among the terms file Organisation and the access method. A file organisation shows to t

How nulls are treated in comparison operator? Along with comparison (relational) operators, the null values are ignored as we cannot derive the relation along with the given op

1. Create a subroutine that does the remote blast on the file protein.fa. 2. Pass that returned files from the blast to another subroutine that parses the output and sends it to

Write short notes on tuple relational calculus. The tuple relational calculation is anon procedural query language. It defines the desired information without giving a particul

Question: This form represents one of a number used for each sailing of a range of boats. A passenger may go on many sailings and will have the same passenger number for each.

What is meant by functional dependencies? Consider a relation schema R and α C R and β C R. The functional dependency α ->β  holds on relational schema R if in any legal relati

Question: (a) List four disadvantages of the File Processing System as compared to the Database Systems. (b) The integrity of a database is enforced by integrity rules. One

Consider the following relations:  S (S#, SNAME, STATUS, CITY)  SP (S#, P#, QTY)  P (P#, PNAME, COLOR, WEIGHT, CITY) Give an expression within SQL for each of queries b

Why Like predicate used for? LIKE predicate: The LIKE predicate searches for strings in which have a certain pattern.