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

Assignment Help:

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


Related Discussions:- Find the employee name,salary,department number and average

Command line interfaces, Command Line Interfaces: These are interactive int...

Command Line Interfaces: These are interactive interfaces, character-based that let you use the complete power and functionality of the DBMS query language directly. They permit yo

Neo4j, I have one assignment that has to be done in neo4j

I have one assignment that has to be done in neo4j

Microeconomic, anyone have a textbook solutions case fair, 8 edition of vo...

anyone have a textbook solutions case fair, 8 edition of vol 1 ?, please give me

What is the difference between a key and a superkey, What is the difference...

What is the difference between a key and a superkey? Key - A key a single attribute or a combination of two or more attributes of an entity set which is used to identify one

Develop a java application, 1 - Serial RS232 comm port comunication 2 - ...

1 - Serial RS232 comm port comunication 2 - NanoHTTPD serving a few processed pages 3 - System tray application to indicate status and access configuration forms 4 - SQLit

What are the advantages of having an index structure, What are the advantag...

What are the advantages of having an index structure?      Ans: The index structures commonly provide secondary access paths, which offer alternative ways of accessing the reco

Functional dependency, Functional Dependency Consider a relation R that...

Functional Dependency Consider a relation R that has 2 attributes A and B. The attribute B of the relation is functionally dependent on the attribute A if and only if for every

Define rule that value of foreign key appear in other table, Determine the ...

Determine the rule that a value of a foreign key should appear as a value of some particular table is called a  Ans: Referential constraint.    The rule that a value of a fo

State the object design for processing, State the Object Design for Process...

State the Object Design for Processing  The object design phase comes after analysis and system design phase. The object design phase includes implementation details like as i

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