본문 바로가기
취준/코팅 테스트

[LeetCode] - 577.Employee Bonus

by 소복소복뚜벅뚜벅 2024. 3. 18.

문제

Write a solution to report the name and bonus amount of each employee with a bonus less than 1000.

Return the result table in any order.

The result format is in the following example.

 

 

문제 해결

SELECT e.name, b.bonus 
FROM Employee AS e 
LEFT JOIN Bonus AS b ON e.empId = b.empId 
WHERE b.bonus < 1000 OR b.bouns IS NULL

 

 

실수한 점

1. bonus의 NULL 값을 표현하는 방법을 몰랐음 -> IS NULL 쓰면 됩니당....