Academic Integrity: tutoring, explanations, and feedback — we don’t complete graded work or submit on a student’s behalf.

Help! This is the question I have to answer: Display the manager number and sala

ID: 3670695 • Letter: H

Question

Help! This is the question I have to answer:

Display the manager number and salary of the lowest paid employee for that manager. Exclude anyone whose manager is not known (NULL). Exclude any groups where the minimum salary is less than $1000. Sort the output in descending order of salary.

This is the code I wrote:

SELECT manager_id AS "Manager", MIN(salary) AS "Small Salary"
FROM employees
WHERE manager_id IS NOT NULL
GROUP BY manager_ID
HAVING MIN(salary) < 1000
ORDER BY "Small Salary" DESC;

It runs but it comes up with 0 records. What am I doing wrong?

Explanation / Answer

SELECT manager_id, MIN(salary)

FROM employees

WHERE manager_id IS NOT NULL

GROUP BY manager_id

HAVING MIN(salary) > 6000

ORDER BY MIN(salary) DESC;

Hire Me For All Your Tutoring Needs
Integrity-first tutoring: clear explanations, guidance, and feedback.
Drop an Email at
drjack9650@gmail.com
Chat Now And Get Quote