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
crete a data base relationship model Entity: Students; Professors; Dormitories buildings; Attributes of students: Name; Address; Dorm;

Waterfall model is the linear model. The process is completed by step by step. We couldn't stop in between of the process. Prototype model: after get the model by low cost budget o

what is meant semantic query optimization? how does it differ from other query optimization techniques?

Describe the objective of Structural Diagrams The main objective of structural diagram is to visualize, construct, specify and document static aspects of a system. Their eleme

Inheritance Adjustment As in object oriented analysis and design terms inheritance defines a relationship between classes, where as one class shares structure or behaviour def

A student entity type has the following attributes,name..


The basic merits of decomposition. The Advantages of Decomposition 1.  Separate person can work on each subsystem. 2.  A particular software engineer can specialize in a

What is property - properties of a database ? It is an integrated collection of logically related records. It consolidates separate files into a common pool of data records and

Which two tools are used to administer users for Active Directory?