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

Which model is record based logical model, Which model is record based logi...

Which model is record based logical model? Network Modelis basically known as record based logical model.

What do you mean through integrity constraints, What do you mean through in...

What do you mean through integrity constraints? Integrity Constraints -An integrity constraint is a condition specified on a database schema and restricts the data in which

Fragmentation, let us consider a table having 2200 records and the fixed si...

let us consider a table having 2200 records and the fixed size of the table to be considered as 25.then how many numbers of table is requredto perform horizontal fragmentation

Erd, er diagram on cosmetics.

er diagram on cosmetics.

What is candidate key, What is Candidate Key Super Key or Candidate Ke...

What is Candidate Key Super Key or Candidate Key: It is such an attribute of a table that can uniquely recognize a row in a table. Generally they have unique values and can n

Architectural standard, Architectural standard: Designation : Archit...

Architectural standard: Designation : Architect , Consultant Job Profile : As a part of Oracle Fusion Middleware at Satyam, I am involved with Presales, Delivery, A

What are the objectives of object design, What are the Objectives of object...

What are the Objectives of object design After going through this unit, you could be able to: explain steps of object design; discuss algorithms that reduce costs;

Report writing help on database mgmt, Report writing help on database mgmt ...

Report writing help on database mgmt Project Description: Use of Harvard referencing, critical analysis is required. Skills required: Academic Writing, Technical Writin

Explain growing phase of locking, Explain Growing Phase of locking Grow...

Explain Growing Phase of locking Growing Phase: In this phase the transaction can only obtain locks, but cannot release any lock. The transaction enters the growing phase as so

Write short notes on schema diagram, Write short notes on Schema diagram. ...

Write short notes on Schema diagram. A database schema along with primary key and foreign key dependencies can be depicted pictorially by schema diagram. Every relation appears

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