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

Which data type can store unstructured data, Which data type can store unst...

Which data type can store unstructured data? Raw data type can store unstructured data.

Increased parallelism-data replication, Increased parallelism : Since the r...

Increased parallelism : Since the replicated date has several copies a query can be distributed or can be answered from the smallest loaded site. Also, with more replicas you have

I need helpin assignment, My cut off date is very soon in a Database subjec...

My cut off date is very soon in a Database subject and i dont know how to solve anything in it

Data analysis and design, give some example real-life situations where DBMS...

give some example real-life situations where DBMS are most suiitabe

Creating a view-data control, Creating a view: A query can be embed...

Creating a view: A query can be embedded within the CREATE VIEW STATEMENT A query can have complex select statements containing join, groups and sub- queries A quer

Dataware house, ) Define a job scheduling strategy that will meet business ...

) Define a job scheduling strategy that will meet business requirement of reporting availability by 6am CST for the following cubes? Show the job scheduling dependencies in a picto

Design and build a data mart, You are required to design and build a data m...

You are required to design and build a data mart/data warehouse using Oracle. A national bank allocates funding every year for its local branches to provide temporary staff cove

Describe identifying relationship, Describe identifying relationship? ...

Describe identifying relationship? Identifying relationship: It is relationship among strong entity and a weak entity it is represented through a doubly outlined diamond in C

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