• Courses
  • Tutorials
  • Jobs
  • Practice
  • Contests

UGC-NET | UGC NET CS 2017 Jan - III | Question 11

Consider the following relation:
Works (emp_name, company_name, salary)
Here, emp_name is primary key. Consider the following SQL query
Select emp_name
From works T
where salary > (select avg (salary)
                from works S
                where T.company _ name = S.company _ name)
The above query is for following :

(A)

Find the highest paid employee who earns more than the average salary of all employees of his company.

(B)

Find the highest paid employee who earns more than the average salary of all the employees of all the companies.

(C)

Find all employees who earn more than the average salary of all employees of all the companies.

(D)

Find all employees who earn more than the average salary of all employees of their company.

Answer

Please comment below if you find anything wrong in the above post
Feeling lost in the world of random DSA topics, wasting time without progress? It's time for a change! Join our DSA course, where we'll guide you on an exciting journey to master DSA efficiently and on schedule.
Ready to dive in? Explore our Free Demo Content and join our DSA course, trusted by over 100,000 geeks!

Last Updated :
Share your thoughts in the comments