Find the employee name,salary,department number and average, Database Management System

Example-Find the employee name, salary, department number and average salary of his/her department, for those employees whose salary is more than the average salary of that department.

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

 

SELECT A.ENAME, A.SAL, A.DEPTNO, B.AVGSAL

FROM EMP A, (   SELECT DEPTNO, AVG (SAL) AVGSAL

                              FROM EMP

                               GROUP BY DEPTNO) B

WHERE A.DEPTNO=B.DEPTNO AND A.SAL> B. AVGSAL;

Output:

ENAME

SAL

DEPTNO

AVGSAL

Kailash

3000

10

2987.5

Karuna

5000

20

4000

Posted Date: 3/11/2013 3:59:56 AM | Location : United States







Related Discussions:- Find the employee name,salary,department number and average, Assignment Help, Ask Question on Find the employee name,salary,department number and average, Get Answer, Expert's Help, Find the employee name,salary,department number and average Discussions

Write discussion on Find the employee name,salary,department number and average
Your posts are moderated
Related Questions
Explain heap file with advantages? Heap File is an unordered set or a group of records, stored on a set of pages. This class gives basic support for inserting, updating, select

The primary key is selected from the

it can be possible to create any table without primary key

Define the Division Operation of Relational Algebra Let R be a relation comprising attributes (A1,...Ap,Ap+1,...An) and S comprising attributes (Ap+1,...An)  DEF: Division

After the completion of the logical model the physical model is to be made. The oracle 10 G will be used as a database server and all the tables with their column are created and i

What type of view of total database content? Data base content Conceptual view of total database contain.

Differentiate between a unique key and a primary key. - By default, clustered index on column are created by primary key while nonclustered index are created by unique key.

explain at least five widly used case tools

Project Description: This is a Customer Management project. Customer data is presented in a text file. The program can load this text data into its database columns. The data ma

Explain briefly concurrent task by taking an example. Concurrent Task- The concurrent occurrence of more than one event is called concurrent task. Operating systems can handl