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
Define Deadlock detection If a system does not employ a few protocols that make sure deadlock freedom, after that a detection and recovery scheme should be used. An algorithm

What do you mean by DBMS? What is its need and what are its goals. Explain?        OR   Explain Data Base Management System? Sol.  Database management system is a

I am doing research in this area, especially in sime join and join efficacy when several relations have been queried. Relations located in different sites. I need something like n

Differentiate between Procedural and non procedural languages ? Procedural and non procedural languages - A procedural language specifies the operations to be performed on th

What is transaction? Collections of operations that form a single logical unit of work are known as transactions.

An Enterprising group of Entrepreneurs introduced a new business named StoreItRite which is based on data storage and retrieval services. It provides the services and the company c


We need help in Booking System for Golf Business Development of a web based booking system which permits clients to book golf lessons with the following features- a) 4 user p

What is OCR? OCR (Optical Character Recognition) is a technology that enables you to change different types of machine-readable documents, like scanned paper documents, PDF fil

Discuss the differences among the candidate keys and the primary key of a relation. Give instance to describe your answer? A candidate key is one that can be used as primary ke