[코드카타] SQL 52 Employees Whose Manager Left the Company

Data_Student·2024년 11월 27일
0

코드카타

목록 보기
61/82

[코드카타] SQL 52 Employees Whose Manager Left the Company

52 Employees Whose Manager Left the Company
https://leetcode.com/problems/employees-whose-manager-left-the-company/submissions/1463736247/

Find the IDs of the employees whose salary is strictly less than $30000 
and whose manager left the company. When a manager leaves the company, 
their information is deleted from the Employees table, but the reports 
still have their manager_id set to the manager that left.
Return the result table ordered by employee_id.
select employee_id
from Employees
where salary < 30000 
and manager_id not in (select employee_id from Employees)
order by employee_id
Salary가 30000 미만이고, 
manager_id가 employee_id에 포함되지 않는 employee_id 출력
ps. less than 으로 적혀있으면 미만이다!

0개의 댓글