How to display employee records who gets more salary than the average salary in the department?



How to display employee records who gets more salary than the average salary in the department?..

Answer / Kavita Saini

To display employee records who get more salary than the average salary in a department, you can use SQL subqueries and analytic functions. Here's an example using Oracle SQL:nn```sqlnSELECT * FROM employeesnWHERE salary > (SELECT AVG(salary) FROM employees WHERE department_id = employees.department_id);n```

Is This Answer Correct ?    0 Yes 0 No

Post New Answer

More Oracle General Interview Questions

why dont we assign not null constraint as table level constraint.

1 Answers  


How many different types of indexes we have in oracle?

24 Answers   IBM, TCS,


How to use "if" statements on multiple conditions?

1 Answers  


i want to know about mr.b.kotravel......who has answered for second maxmium salary from employee table

3 Answers  


difference between truncate and delete ,drop?

3 Answers  


What is the difference between post-database commit and post-form commit?

1 Answers  


find out first highest salary?

10 Answers   Verinon Technology Solutions,


How to turn on or off recycle bin for the instance?

1 Answers  


What suggestions do you have to reduce the network traffic?

1 Answers  


How to define an anonymous block?

1 Answers  


Will the Optimizer always use COST-based approach if OPTIMIZER_MODE is set to "Cost"?

1 Answers  


What are synonyms used for ?

3 Answers  


Categories
  • Oracle General Interview Questions Oracle General (1803)
  • Oracle DBA (Database Administration) Interview Questions Oracle DBA (Database Administration) (261)
  • Oracle Call Interface (OCI) Interview Questions Oracle Call Interface (OCI) (10)
  • Oracle Architecture Interview Questions Oracle Architecture (90)
  • Oracle Security Interview Questions Oracle Security (38)
  • Oracle Forms Reports Interview Questions Oracle Forms Reports (510)
  • Oracle Data Integrator (ODI) Interview Questions Oracle Data Integrator (ODI) (120)
  • Oracle ETL Interview Questions Oracle ETL (15)
  • Oracle RAC Interview Questions Oracle RAC (93)
  • Oracle D2K Interview Questions Oracle D2K (72)
  • Oracle AllOther Interview Questions Oracle AllOther (241)