Exercise - Employee Databasee
Exercise - Employee Databasee
A. BASIC QUERIES
2. Write a SQL query to find the salaries of all employees. Return salary.
3. Write a SQL query to find the unique designations of the employees. Return job name.
4. Write a query in SQL to list the emp_id, salary, and commission of all the employees.
5. Write a SQL query to find the unique department with jobs. Return department ID, Job
name.
6. Write a SQL query to find those employees who do not belong to the department 2001.
Return complete information about the employees.
7. Write a SQL query to find those employees who joined before 1991. Return complete
information about the employees.
8. Write a SQL query to calculate the average salary of employees who work as analysts.
Return average salary.
10. Write a SQL query to identify employees whose commissions exceed their salaries.
Return complete information about the employees.
11. Write a SQL query to identify those employees whose salaries exceed 3000 after
receiving a 25% salary increase. Return complete information about the employees.
13. Write a SQL query to find those employees whose designation is ‘CLERK’. Return
complete information about the employees.
14. Write a SQL query to find those employees whose salaries are less than 3500. Return
complete information about the employees.
15. Write a SQL query to find the employee whose designation is ‘ANALYST’. Return
employee name, job name and salary.
16. Write a SQL query to find those employees who joined before 1st April 1991. Return
employee ID, employee name, hire date and salary.
17. Write a SQL query identify the employees who do not report to a manager. Return
employee name, job name.
18. Write a SQL query to find the employees who joined on the 1st of May 1991. Return
complete information about the employees.
19. Write a SQL query to identify the experience of the employees who work under the
manager whose ID number is 68319. Return employee ID, employee name, salary,
experience.
20. Write a SQL query to find out which employees earn more than 100 per day as a salary.
Return employee ID, employee name, salary, and experience.
21. Write a SQL query to find those employees who joined in the month of APRIL. Return
complete information about the employees.
22. Write a SQL query to find those employees of department id 3001 or 1001 and joined in
the year 1991. Return complete information about the employees.
· The employees receive some commission which should not be more than the salary and
annual salary including commission is below 34000.
· Designation is ‘SALESMAN’ and working in the department ‘3001’. Return employee ID,
employee name, salary and job name.
25. Write a SQL query to find those employees who are either CLERK or MANAGER. Return
complete information about the employees.
26. Write a SQL query to identify those employees who joined in any month other than
February. Return complete information about the employees.
27. Write a SQL query to find those employees who joined in the year 1991. Return
complete information about the employees.
28. Write a SQL query to search for all employees with an annual salary between 24000 and
50000 (Begin and end values are included.). Return complete information about the
employees.
Ans select * from employees where 12* salary between 24000 and 50000;
28. Write a SQL query to identify all employees who joined the company on 1st May, 20th
February, and 3rd December 1991. Return complete information about the employees.
29. Write a SQL query to find which employees joined the company after the month of June
in 1991 and within this year. Return complete information about the employees.
Ans SELECT * FROM employees where manager_id in(63679, 68319, 66564, 69000);
32. Write a SQL query to find those managers who are in the department 1001 or 2001.
Return complete information about the employees.
33. Write a SQL query to search for employees who are working either as a MANAGER or
an ANALYST with a salary between 2000 and 5000 (Begin and end values are included.)
without commissions. Return complete information about the employees.
34. Write a SQL query to find the employees and their salaries. Sort the result-set in
ascending order by salaries. Return complete information about the employees.
35. Write a SQL query to sort the unique jobs in descending order. Return job name.
36. Write a SQL query to find those employees who are either 'CLERK' or 'ANALYST’. Sort
the result set in descending order on job_name. Return complete information about the
employees.
37. Write a SQL query to find those employees who joined on 1-MAY-91, or 3-DEC-91, or
19-JAN-90. Sort the result-set in ascending order by hire date. Return complete
information about the employees.
38. Write a SQL query to find those employees who earn less than 1000. Sort the result-set
in ascending order by salary. Return complete information about the employees.
39. Write a SQL query to list the unique jobs of department 2001 and 3001 in descending
order. Return job name.
Ans SELECT DISTINCT job_name FROM employees WHERE dep_id IN (2001, 3001)
ORDER BY job_name DESC;
40. Write a SQL query to list all the employees except the PRESIDENT and the MANAGER
in ascending order of salaries. Return complete information about the employees.
Ans SELECT *FROM employees WHERE (salary * 12) < 25000ORDER BY salary
ASC;
42. Write a SQL query to list the employees who works as a SALESMAN. Sort the result set
in ascending order of annual salary. Return employee id, name, annual salary, daily
salary of all the employees.
43. Write a SQL query to find those employees who work in the department 1001. Sort the
result-set in ascending order by salary. Return employee ID, employee name, salary and
department ID.
44. Write a SQL query to find the highest salary. Return highest salary.
45. Write a SQL query to find the average salary and average total remuneration (salary and
commission) for each type of job. Return name, average salary and average total
remuneration.
46. Write a SQL query to count the number of employees in each designation of a
department. Return department id, job name and number of employees.
47. Write a SQL query to identify the departments in which at least two employees are
employed. Return department id, number of employees.
48. Write a SQL query to identify departments with fewer than four employees. Return
department ID, number of employees.
49. Write a SQL query to check whether the employees ID are unique or not. Return
employee id, number of employees
50. Write a SQL query to find number of employees and average salary. Group the result set
on department id and job name. Return number of employees, average salary,
department ID, and job name.
Ans SELECT count(*), avg(salary), dep_id, job_name FROM employees GROUP BY
dep_id, job_name;
51. Write a SQL query to find those employees whose names contain the character set 'AR'
together. Return complete information about the employees.
52. Write a SQL query to find those employees whose names contain the letter 'a’. Return
complete information about the employees.
53. Write a SQL query to compute the total salary of the designation MANAGER. Return
total salary.
1. Write a SQL query to find employees along with their department details. Return
employee ID, employee name, job name, manager ID, hire date, salary, commission,
department ID, and department name.
2. Write a SQL query to identify those employees who earn 60000 or more per year or do
not work as ANALYST. Return employee name, job name, (12*salary) as Annual Salary,
department ID, and grade.
3. Write a SQL query to identify employees whose salaries are higher than their managers'
salaries. Return employee name, job name, manager ID, salary, manager name,
manager's salary.
5. Write a SQL query to find those employees whose salary is between 2000 and 5000
(Begin and end values are included.) and location is PERTH. Return employee name,
department ID, salary, and commission.
6. Write a SQL query to find the employees whose department ID is 1001 or 3001 and
whose salary grade is not 4. They joined the company before 1992-12-31. Return grade,
employee name.
7. Write a SQL query to find those employees whose manager name is JONAS. Return
employee id, employee name, job name, manager ID, hire date, salary, department ID,
and employee name.
8. Write a SQL query to find the name and salary of the employee FRANK. Salary should be
equal to the maximum salary within his or her salary group.
9. Write a SQL query to find those employees who are senior to their manager. Return
complete information about the employees
AnsSELECT * FROM employees e, employees m WHERE e.manager_id = m.emp_i
d AND e.hire_date < m.hire_date;
10. Write a SQL query to determine which employees have a grade of 4 and a salary
between the minimum and maximum. Return all information of each employees and their
grade and salary related details.
11. Write a SQL query to find the department location of employee ‘CLARE’. Return
department location.
12. Write a SQL query to find the location of all the employees working in the FINANCE or
AUDIT department. Sort the result-set in ascending order by department ID. Return
complete information about the employees.
13. Write a SQL query to find the employees along with grades in ascending order. Return
complete information about the employees.
14. Write a SQL query to find the employees according to the department in ascending
order. Return name, job name, department, salary, and grade.
15. Write a SQL query to select all employees except CLERK and sort the results in
descending order by salary. Return employee name, job name, salary, and grade and
department name.
24. Write a SQL query to find the managers. Return complete information about the
managers.
Ans select * from empolyees e, salary_grade where emp_id in(select manager_id from
employee);
25. Write a SQL query to find the employees of grade 2 and 3.Return all the information of
employees and salary details.
26. Write a SQL query to find those employees of grade 4 or 5 and who work as ANALYST
or MANAGER. Return complete information about the employees.
27. Write a SQL query to find those employees whose salary is more than the salary of
JONAS. Return complete information about the employees.
AnsSELECT * FROM employees WHERE salary > (SELECT salary FROM employees
WHERE emp_name = 'JONAS');
28. Write a SQL query to find those employees who work as same designation of FRANK.
Return complete information about the employees.
29. Write a SQL query to find those employees who are senior to ADELYN. Return complete
information about the employees.
AnsSELECT * FROM employees WHERE hire_date < (SELECT hire_date FROM emp
loyees WHERE emp_name = 'ADELYN');
30. Write a SQL query to find those employees of department ID 2001 and whose
designation is same as of the designation of department ID 1001. Return complete
information about the employees.
AnsSELECT * FROM employees e WHERE e.dep_id = 2001 AND e.job_name IN ( S
ELECT job_name FROM employees WHERE dep_id = 1001 );
32. Write a SQL query to find those employees whose salary is the same as the salary of
FRANK or SANDRINE. Sort the result-set in descending order by salary. Return complete
information about the employees.
Ans SELECT * FROM employees WHERE salary IN(SELECT salary FROM employees
WHERE (emp_name = 'FRANK' OR emp_name = 'BLAZE') AND employees.emp_id <>
e.emp_id)ORDER BY salary DESC;
33. Write a SQL query to find those employees whose designation are the same as the
designation of MARKER or salary is more than the salary of ADELYN. Return complete
information about the employees.
34. Write a SQL query to find those employees whose salary is more than the total
remuneration (salary + commission) of the designation SALESMAN. Return complete
information about the employees.
Ans SELECT * FROM employees WHERE salary > (SELECT salary + commission FROM
employees WHERE job_name = 'SALESMAN');
35. Write a SQL query to find those employees who are senior to BLAZE and working at
PERTH or BRISBANE. Return complete information about the employees.
Ans SELECT * FROM employees WHERE hire_date < (SELECT hire_date FROM
employees WHERE emp_name = 'BLAZE') AND location IN ('PERTH', 'BRISBANE');
36. Write a SQL query to find those employees of grade 3 and 4 and work in the department
of FINANCE or AUDIT and whose salary is more than the salary of ADELYN and experience
is more than FRANK. Return complete information about the employees.
Ans SELECT * FROM employees e, department d WHERE (e.grade = 3 OR e.grade = 4)
AND d.dep_name IN ('FINANCE', 'AUDIT') AND e.dep_id = d.dep_id AND e.salary >
(SELECT salary FROM employees WHERE emp_name = 'ADELYN') AND e.experience >
(SELECT experience FROM employees WHERE emp_name = 'FRANK');
37. Write a SQL query to find those employees whose designation is same as the
designation of SANDRINE or ADELYN. Return complete information about the employees.
Ans SELECT * FROM employees WHERE job_name = (SELECT job_name FROM
employees WHERE emp_name = 'SANDRINE') OR job_name = (SELECT job_name FROM
employees WHERE emp_name = 'ADELYN');
38. Write a SQL query to list any job of department ID 1001 which are not found in
department ID 2001. Return job name.
Ans SELECT job_name FROM employees WHERE dep_id = 1001 AND job_name NOT IN
(SELECT job_name FROM employees WHERE dep_id = 2001);
39. Write a SQL query to find the highest paid employee. Return complete information about
the employees.
Ans SELECT * FROM employees WHERE salary = (SELECT MAX(salary) FROM
employees);
40. Write a SQL query to find the highest paid employees in the department MARKETING.
Return complete information about the employees.
Ans SELECT * FROM employees WHERE dep_id = (SELECT dep_id FROM department
WHERE dep_name = 'MARKETING') AND salary = (SELECT MAX(salary) FROM
employees WHERE dep_id = (SELECT dep_id FROM department WHERE dep_name =
'MARKETING'));
41. Write a SQL query to find the employees of grade 3 who joined recently and location at
PERTH. Return employee ID, employee name, job name, hire date, and salary.
Ans SELECT e.emp_id, e.emp_name, e.job_name, e.hire_date, e.salary FROM employees
e WHERE e.dep_id IN (SELECT d.dep_id FROM department d WHERE d.dep_location =
'PERTH') AND e.hire_date IN (SELECT max(hire_date) FROM employees WHERE emp_id
IN (SELECT emp_id FROM employees e, salary_grade s WHERE e.salary BETWEEN
s.min_sal AND s.max_sal AND s.grade = 3)));
42. Write a SQL query to find those employees who are senior to those recently hired
employee who worked under KAYLING. Return complete information about the employees.
Ans SELECT * FROM employees WHERE hire_date < (SELECT max(hire_date) FROM
employees WHERE manager_id IN (SELECT emp_id FROM employees WHERE
emp_name = 'KAYLING'));
43. Write a SQL query to find those employees of grade 3 to 5 and location at SYDNEY. The
employees are not in PRESIDENT designated and salary is more than the highest paid
employee of PERTH where no MANAGER and SALESMAN are working under KAYLING.
Return complete information about the employees.
Ans SELECT * FROM employees WHERE dep_id IN (SELECT dep_id FROM department
WHERE department.dep_location = 'SYDNEY') AND emp_id IN (SELECT emp_id FROM
employees e, salary_grade s WHERE e.salary BETWEEN s.min_sal AND s.max_sal AND
s.grade IN (3, 4, 5)) AND job_name != 'PRESIDENT' AND salary > (SELECT max(salary)
FROM employees WHERE dep_id IN (SELECT dep_id FROM department WHERE
department.dep_location = 'PERTH') AND job_name IN ('MANAGER', 'SALESMAN') AND
manager_id NOT IN (SELECT emp_id FROM employees WHERE emp_name =
'KAYLING')));
44. Write a SQL query to find the most senior employee of grade 4 or 5, work under
KAYLING. Return complete information about the employees.
Ans SELECT * FROM employees WHERE hire_date IN (SELECT min(hire_date) FROM
employees WHERE emp_id IN (SELECT emp_id FROM employees e, salary_grade s
WHERE e.salary BETWEEN s.min_sal AND s.max_sal AND s.grade IN (4, 5))) AND
manager_id IN (SELECT emp_id FROM employees WHERE emp_name = 'KAYLING'));
45. Write a SQL query to compute the total salary of employees of grade 3. Return total
salary.
Ans SELECT sum(salary) FROM employees WHERE emp_id IN (SELECT emp_id FROM
employees e, salary_grade s WHERE e.salary BETWEEN s.min_sal AND s.max_sal AND
s.grade = 3);
46. Write a SQL query to find those employees of department 1001 and whose salary is
more than the average salary of employees in department 2001. Return complete
information about the employees.
Ans SELECT * FROM employees WHERE dep_id = 1001 AND salary > (SELECT
AVG(salary) FROM employees WHERE dep_id = 2001);
47. Write a SQL query to find those employees whose manager is JONAS. Return complete
information about the employees.
48. Write a SQL query to find those employees who are not working in the department
MARKETING. Return complete information about the employees.
Ans SELECT * FROM employees WHERE manager_id IN (SELECT emp_id FROM
employees WHERE emp_name = 'JONAS');
49. Write a SQL query to find those employees who are working as a manager. Return
employee name, job name, department name, and location.
Ans SELECT e.emp_name, e.job_name, d.dep_name, d.dep_location FROM employees e,
department d WHERE e.dep_id = d.dep_id AND e.emp_id IN (SELECT manager_id FROM
employees);
50. Write a SQL query to find those employees who receive the highest salary of each
department. Return employee name and department ID.
Ans SELECT e.emp_name, e.dep_id FROM employees e WHERE e.salary = (SELECT
MAX(salary) FROM employees e2 WHERE e2.dep_id = e.dep_id);
51. Write a SQL query to find those employees whose salary is equal or more to the average
of maximum and minimum salary. Return complete information about the employees.
Ans SELECT * FROM employees WHERE salary >= (SELECT (max(salary) + min(salary)) /
2 FROM employees);
52. Write a SQL query to find those managers whose salary is more than the average salary
of his employees. Return complete information about the employees.
53. Write a SQL query to find those employees whose salary is less than the salary of his
manager but more than the salary of any other manager. Return complete information about
the employees.
Ans SELECT * FROM employees w, employees m WHERE w.manager_id = m.emp_id AND
w.salary < m.salary AND w.salary > ANY (SELECT salary FROM employees WHERE
emp_id IN (SELECT manager_id FROM employees));
54. Write a SQL query to compute department wise average salary of employees. Return
employee name, average salary, department ID as "Current Salary".
Ans SELECT e.emp_name, d.avgsal, e.dep_id AS "Current Salary" FROM employees e,
(SELECT avg(salary) avgsal, dep_id FROM employees GROUP BY dep_id) d WHERE
e.dep_id=d.dep_id;
55. Write a SQL query to find those managers who are not working under the PRESIDENT.
Return complete information about the employees.
Ans SELECT e.* FROM employees e WHERE e.manager_id IS NOT NULL AND
e.manager_id != (SELECT emp_id FROM employees WHERE emp_name = 'PRESIDENT');
56. Write a SQL query to find those employees who joined in the company on the same
date. Return complete information about the employees.
Ans SELECT * FROM employees e WHERE hire_date IN (SELECT hire_date FROM
employees WHERE e.emp_id <> emp_id);
57. Write a SQL query to find those managers who receive less salary then the employees
work under them. Return complete information about the employees.
Ans SELECT * FROM employees w WHERE salary < ANY (SELECT salary FROM
employees WHERE w.emp_id = manager_id);
58. Write a SQL query to find those employees who are sub-ordinates of BLAZE. Return
complete information about the employees.
Ans SELECT * FROM employees WHERE manager_id IN (SELECT emp_id FROM
employees WHERE emp_name = 'BLAZE');
59. Write a SQL query to list the name of the employees for their manager JONAS and the
name of the manager of JONAS.
Ans SELECT w.emp_name, m.emp_name, (SELECT emp_name FROM employees
WHERE m.manager_id = emp_id) "his MANAGER" FROM employees w, employees m
WHERE w.manager_id = m.emp_id AND m.emp_name = 'JONAS';
60. Write a SQL query to find those employees who receive minimum salary for a
designation. Sort the result-set in ascending order by salary. Return complete information
about the employees.
Ans SELECT * FROM employees WHERE salary IN (SELECT min(salary) FROM
employees GROUP BY job_name) ORDER BY salary ASC;
61. Write a SQL query to find those employees who receive maximum salary for a
designation. Sort the result-set in descending order by salary. Return complete information
about the employees.
Ans SELECT * FROM employees WHERE salary IN (SELECT max(salary) FROM
employees GROUP BY job_name) ORDER BY salary DESC;
62. Write a SQL query to find recently hired employees of every department. Sort the result-
set in descending order by hire date. Return complete information about the employees.
Ans SELECT * FROM employees e WHERE hire_date IN (SELECT max(hire_date) FROM
employees WHERE e.dep_id = dep_id) ORDER BY hire_date DESC;
63. Write a SQL query to find those employees who receive a salary higher than the average
salary of their department. Sort the result-set in ascending order by department ID. Return
employee name, salary, and department ID.
Ans SELECT e.emp_name, e.salary, e.dep_id FROM employees e WHERE salary >
(SELECT avg(salary) FROM employees WHERE e.dep_id = dep_id) ORDER BY dep_id;
64. Write a SQL query to find those employees who earn a commission and receive
maximum salary. Return complete information about the employees.
Ans SELECT * FROM employees WHERE salary = (SELECT max(salary) FROM
employees WHERE commission IS NOT NULL);
65. Write a SQL query to find those employees who do not work in the department 1001 but
work in the same designation and salary as the employees in department 3001. Return
employee name, job name and salary.
Ans SELECT emp_name, job_name, salary FROM employees WHERE dep_id != 1001 AND
job_name IN (SELECT job_name FROM employees WHERE dep_id = 3001) AND salary IN
(SELECT salary FROM employees WHERE dep_id = 3001);
66. Write a SQL query to find those employees who get a commission percent and works as
a SALESMAN and earn maximum net salary. Return department ID, name, designation,
salary, and net salary (salary+ commission).
Ans SELECT dep_id, emp_name, salary, job_name, salary+commission "Net Salary" FROM
employees e WHERE 2-1 = (SELECT count(DISTINCT emp.salary+emp.commission)
FROM employees emp WHERE emp.salary+emp.commission>e.salary+e.commission);
67. Write a SQL query to find those departments where the average salary is less than the
averages for all departments. Return department ID, average salary.
Ans SELECT dep_id, avg(salary) FROM employees GROUP BY dep_id HAVING
avg(salary) < (SELECT avg(salary) FROM employees);
68. Write a SQL query to find the unique department of the employees. Return complete
information about the employees.
69. Write a SQL query to list the details of the employees working at PERTH.
Ans SELECT DISTINCT * FROM employees WHERE dep_id IN (SELECT DISTINCT dep_id
FROM employees);
70. Write a SQL query to list the employees of grade 2 or 3 and the department where he or
she works, is located in the city PERTH. Return complete information about the employees.
Ans SELECT e.* FROM employees e JOIN departments d ON e.dept_id = d.dept_id
WHERE e.grade IN (2, 3) AND d.location = 'PERTH';
71. Write a SQL query to find those employees whose designation is same as the
designation of ADELYN or the salary is more than the salary of WADE. Return complete
information about the employees.
Ans SELECT * FROM employees WHERE designation = (SELECT designation FROM
employees WHERE emp_name = 'ADELYN') OR salary > (SELECT salary FROM
employees WHERE emp_name = 'WADE');
72. Write a SQL query to find those employees of department 1001 whose salary is more
than the salary of ADELYN. Return complete information about the employees.
Ans SELECT * FROM employees WHERE dept_id = 1001 AND salary > (SELECT salary
FROM employees WHERE emp_name = 'ADELYN');
73. Write a SQL query to find those managers who are senior to KAYLING and who are
junior to SANDRINE. Return complete information about the employees.
Ans SELECT * FROM employees e1 WHERE e1.designation = 'Manager' AND e1.salary >
(SELECT salary FROM employees WHERE emp_name = 'KAYLING') AND e1.salary <
(SELECT salary FROM employees WHERE emp_name = 'SANDRINE');
74. Write a SQL query to find those employees who work in the department where KAYLING
works. Return employee ID, employee name, department location, salary department name.
Ans SELECT e.emp_id, e.emp_name, d.location, e.salary, d.dept_name FROM employees
e JOIN departments d ON e.dept_id = d.dept_id WHERE e.dept_id = (SELECT dept_id
FROM employees WHERE emp_name = 'KAYLING');
75. Write a SQL query to find those employees whose salary grade is greater than the grade
of MARKER. Return complete information about the employees.
Ans SELECT * FROM employees WHERE salary_grade > (SELECT salary_grade FROM
employees WHERE emp_name = 'MARKER');
76. Write a SQL query to find those employees whose salary is same as any one of the
employee. Return complete information about the employees.
Ans SELECT * FROM employees e1 WHERE e1.salary IN (SELECT salary FROM
employees e2 WHERE e1.emp_id != e2.emp_id);
77. Write a SQL query to find compute the total remuneration (salary + commission) of all
sales person of MARKETING department. Return complete information about the
employees.
Ans SELECT e.*, (e.salary + e.commission) AS total_remuneration FROM employees e
JOIN departments d ON e.dept_id = d.dept_id WHERE e.designation = 'Salesperson' AND
d.dept_name = 'MARKETING';
78. Write a SQL query to find the recently hired employees of department 3001. Return
complete information about the employees.
Ans SELECT * FROM employees WHERE dept_id = 3001 ORDER BY hire_date DESC
LIMIT 1;
79. Write a SQL query to find the highest paid employees of PERTH who joined before
recently hired employee of grade 2. Return complete information about the employees.
Ans SELECT e.* FROM employees e JOIN departments d ON e.dept_id = d.dept_id
WHERE d.location = 'PERTH' AND e.hire_date < (SELECT hire_date FROM employees
WHERE grade = 2 ORDER BY hire_date DESC LIMIT 1) AND e.salary = (SELECT
MAX(salary) FROM employees WHERE dept_id = e.dept_id AND d.location = 'PERTH');
80. Write a SQL query to find the highest paid employees work under KAYLING. Return
complete information about the employees.
Ans SELECT * FROM employees WHERE manager_id = (SELECT emp_id FROM
employees WHERE emp_name = 'KAYLING') AND salary = (SELECT MAX(salary) FROM
employees WHERE manager_id = (SELECT emp_id FROM employees WHERE emp_name
= 'KAYLING'));
81. Write a SQL query to find those employees whose net pay are higher than or equal to
the salary of any other employee in the company. Return employee name, salary, and
commission.
Ans SELECT e.emp_name, e.salary, e.commission FROM employees e WHERE (e.salary +
e.commission) >= ALL (SELECT salary FROM employees);
82. Write a SQL query to find those employees whose salaries are greater than the salaries
of their managers. Return complete information about the employees.
Ans SELECT e.* FROM employees e JOIN employees m ON e.manager_id = m.emp_id
WHERE e.salary > m.salary;
83. Write a SQL query to count the number of employees who work as a. manager. Return
number of employees.