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

Design a gennalization and specialization hierarchy for an a, Design a genn...

Design a gennalization and specialization hierarchy for an automobile sales company

Insulation between conceptual and physical structures, Insulation between c...

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 rdbms, What is RDBMS? Relational Data Base Management Systems (...

What is RDBMS? Relational Data Base Management Systems (RDBMS) are database management systems that maintain data records and indices in tables. Relationships may be formed and

2phase locking, we need example of 2phase locking

we need example of 2phase locking

How many types of locks are there, Depending upon the rules we have found, ...

Depending upon the rules we have found, we can classify the locks into two types. Shared Lock: A transaction might be acquiring shared lock on a data item in order to read it

Assignment SQL Management Server 2012, Have database built but having probl...

Have database built but having problems with some questions that go with the database

Normalise data to third normal form, A software contract and consultancy fi...

A software contract and consultancy firm maintains details of all the various projects in which its employees are currently involved. These details comprise: Employee Numbe

Data fragmentation, Data Fragmentation "Fragmentation includes decompos...

Data Fragmentation "Fragmentation includes decomposing the data in relation to non-overlapping component relations". Why do we require fragmenting a relation?

Convert the erd into its relevant relational schema, Question: Describe...

Question: Describe briefly the three parts of the Relational Model. (a) The term integrity refers to the accuracy or correctness of the data in the database. Define the fol

What is the full form of ddl, What is the full form of DDL? DDL is stan...

What is the full form of DDL? DDL is stand for Data Definition Language.

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