Monday, 27 August 2012

evaluate the SQL statement: SELECT a.emp_name, a.sal, a.dept_id, b.maxsal FROM employees a, (SELECT dept_id, MAX (sal) maxsal 4 FROM employees GROUP BY dept_id) b WHERE a.dept_id = b.dept_id AND a.sal<b.maxsal; What is the result of the statement? | Oracle

A. The statement produces an error at line1.
B. The statement produces an error at line3.
C. The statement produces an error at line6.
D. The statement returns the employee name, salary, department ID, and maximum salary earned in the department of the employee for all departments that pay less salary than the maximum salary aid in the company.
E. The statement returns the employee name, salary, department ID, and maximum salary earned in the department of the employee for all employees who earn less than the maximum salary in their department.

Ans:E

No comments: