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’

Characteristics, what are the main characteristics of database

what are the main characteristics of database

Explain the deadlock avoidance, Define deadlock avoidance. An alternat...

Define deadlock avoidance. An alternative method for avoiding deadlocks is to needs additional information about how resources are to be requested. Each request requires the s

Decompose the table with the functional dependencies, Decompose the table w...

Decompose the table with the following description and functional dependencies into a set of equivalent tables normalized to 3NF or BCNF. This database stores records from a (ve

What is primary index, Primary Index In primary index, there is a one-t...

Primary Index In primary index, there is a one-to-one relationship among the entries in the index table and the records in the major table. Primary index can be of two types:

Explain i command in qbe, Explain I command in QBE ? I : It is the co...

Explain I command in QBE ? I : It is the command in QBE that is used to insert tuple (s) into the database

Create a database for their customers, The ABC Bank authority now wants to ...

The ABC Bank authority now wants to create a database for their customers. So you are requested to modify your program of Assignment A3 as follows. The main program first displa

Entity identifier key attributes, An entity type usually has an attribute w...

An entity type usually has an attribute whose values are distinct for every individual entity in the collection. Such an attribute is known as a key attribute and its values can be

Extended star schema, Northwind Pty Ltd sells a variety of food products th...

Northwind Pty Ltd sells a variety of food products throughout the world.  They want to use the reporting features of SAP's Business Information Warehouse to better understand their

Discuss the method for a hash file to expand shrink dynamic, Discuss the me...

Discuss the methods for a hash file to expand and shrink dynamically. What are the advantages and disadvantages of each? The hashing methods that permit dyanamic file expansi

What are the different approaches for database design, What are the differe...

What are the different approaches for database design? There are two basic approaches for database design which are as follows: Attribute driven: It compiles a list of att

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