10 Advanced SQL Interview Questions
10 Advanced SQL Interview Questions
9. Identify Employees Who Earn More Than the Average Salary in Their
Department
Scenario: HR wants to review salary structure.
Table: employees(emp_id, name, dept_id, salary)
Question:
SELECT *
FROM employees e
WHERE salary > (
SELECT AVG(salary)
FROM employees
WHERE dept_id = e.dept_id
);
(Dipankar pal)
(www.linkedin.com/in/dipankar-data-analyst)
(Dipankar pal)
(www.linkedin.com/in/dipankar-data-analyst)