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
Which is an advantage of view? The Advantages of view is Data security, Derived columns and Hiding of complex queries

What is SQL Server Agent? SQL Server agent plays a significant role in the day-to-day tasks of a database administrator (DBA). It is often overlooked as one of the major tools

Lack of standards and experience: The lack of standards has considerably limited the potential of distributed DBMSs. As well, there are no tools or methodologies to help users cha


#questiononsider the following relation: CAR_SALE =(CAR_ID,oPTION_TYPE, Option_listpreice, Sale_date, Option_discountedprice)..

Define the Third Normal Form: The third normal form (3NF) is a normal form employed in database normalization. 3NF was initially defined by E.F. Codd in 1971. Codd's definitio

Insulation between conceptual and physical structures It can be defined as: 1. The Database Administrator should be capable to vary the storage structures without affectin

what is Nested relational model? Explain with examples.

Order by clause By using this rows can be sorted It is used in the last portion of select statement By default it gets ascending order DESC: is used

#question.explain diversity and magnitude of organic compounds and general properties?