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 is aggregate function, What is aggregate function? Briefly describe it...

What is aggregate function? Briefly describe it? Aggregate functions are functions that take a collection of values as input and return a one value. SQL offers 5 built-in aggre

Define deadlock avoidance, Define Deadlock avoidance These protocols a...

Define Deadlock avoidance These protocols as well ensure that the system will never enter a deadlock state although the way it is done is different from deadlock prevention. I

Define normalization, Normalization :It is a process of examine the given ...

Normalization :It is a process of examine the given relation schemas based on their primary key and Functional Dependencies (FDs) to achieve the properties Minimizing redun

Describe graphical user interface, Describe Graphical User Interface? ...

Describe Graphical User Interface? Graphical User Interfaces (GUIs) - A GUI typically displays a schema to the user in diagrammatic form. The user can then specify a query th

What is foreign key, What is foreign key? A relation schema r1 derived ...

What is foreign key? A relation schema r1 derived from an ER schema may contain among its attributes the primary key of another relation schema r2.this attribute is known as a

Define partial, Partial Key : It is a group of attributes that can uniquel...

Partial Key : It is a group of attributes that can uniquely identify small entities and that are related to same base entity. It is sometime named as Discriminator.  Altern

Explain data abstraction, Explain data abstraction? Data abstraction Da...

Explain data abstraction? Data abstraction Data abstraction is a methodology in which enables us to isolate how a compound data object is utilized from the details of how it is

State the objectives-data source, You will be analysing a set of financial ...

You will be analysing a set of financial data of your choice. It is not necessary to collect any primary data of your own, and publicly available secondary data will be sufficient

Create an entity relationship diagram, Create an entity relationship diagra...

Create an entity relationship diagram, Database Management System

Describe query evaluation engine, Describe Query evaluation engine? Que...

Describe Query evaluation engine? Query Evaluation engine: Vehicle executes low-level instructions obtained through the DML compiler. The Storage Manager Components gives in

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