Search the salary of employees who are not ‘analyst’ , Database Management System

Assignment Help:

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

 


Related Discussions:- Search the salary of employees who are not ‘analyst’

What are the advantages of embedded query language, What are the advantages...

What are the advantages of embedded query language? Give an example of an embedded SQL query. Embedded query language - SQL could be implemented within two ways. It can be us

Define join and outer join, Define Join and Outer Join and differentiate be...

Define Join and Outer Join and differentiate between them.      Ans: Join - It generates all the combinations of tuples from two relations which satisfy a join condition.  Oute

Join relation of two tuples, Consider the join of a relation R with relatio...

Consider the join of a relation R with relation S. If R has m tuples and S has n tuples, then the maximum size of join is: If R has m tuples and S has n tuples then maximum siz

Explain what is rdbms, Explain what is RDBMS ? RDBMS - RDBMS is a datab...

Explain what is RDBMS ? RDBMS - RDBMS is a database management system (DBMS) which stores data within the form of relations. Relational databases are powerful since they need f

Develop network database ipad app, I want an iPad app that is a simple 1 pa...

I want an iPad app that is a simple 1 page form to complete with text. The Objective is to allow a few dozen people of the same organization (they're all on iPad) to open the app,

Remove all transitive dependencies - dependency diagram, 1. Use the Invoice...

1. Use the Invoice table structure shown below to answer the following questions: a)  Draw the dependency diagram and identify the primary key and all dependencies, including al

Failures and recovery, Failures and Recovery In practice various things...

Failures and Recovery In practice various things might occur to prevent a transaction from completing. Recovery methods are used to bring database, which does not satisfy consi

What is difference among mysql_connect and mysql_pconnect, What is differen...

What is difference among mysql_connect and mysql_pconnect? Mysql_connect() opens a new connection to the database while mysql_pconnect() opens persistent connection to the data

What is interaction diagram, What is Interaction Diagram An interactio...

What is Interaction Diagram An interaction diagram shows an interaction, comprises of a set of objects and their relationships including the messages that may be dispatched be

Process to find the non-concurrent objects, Process to find the non-concurr...

Process to find the non-concurrent objects Once we find out non-concurrent (mutually exclusive) objects, we can fold all objects together in one thread of process or control. O

Write Your Message!

Captcha
Free Assignment Quote

Assured A++ Grade

Get guaranteed satisfaction & time on delivery in every assignment order you paid with us! We ensure premium quality solution document along with free turntin report!

All rights reserved! Copyrights ©2019-2020 ExpertsMind IT Educational Pvt Ltd