๐ป ๋ฌธ์ ์ฃผ์ : Employee Bonus - LeetCode
Employee Bonus - LeetCode
Can you solve this real interview question? Employee Bonus - Table: Employee +-------------+---------+ | Column Name | Type | +-------------+---------+ | empId | int | | name | varchar | | supervisor | int | | salary | int | +-------------+---------+ empId
leetcode.com
๐ป ๋ฌธ์
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.
- ๋ณด๋์ค๋ฅผ 100๋ณด๋ค ์ ๊ฒ ๋ฐ๋ ๋ชจ๋ ์ง์๋ค์ ์ด๋ฆ๊ณผ ๋ณด๋์ค ๊ธ์ก์ ๊ตฌํ์์ค. ์ถ๋ ฅ ์์๋ ์๊ด ์์ต๋๋ค.
๐ป ์ฝ๋ ๋ฐ ํ์ด
select Employee.name, Bonus.bonus
from Employee
left join Bonus using (empId)
where Bonus.bonus < 1000 or Bonus.bonus is null
'SQL > LeetCode' ์นดํ ๊ณ ๋ฆฌ์ ๋ค๋ฅธ ๊ธ
[LeetCode][SQL50] #13. Managers with at Least 5 Direct Reports (0) | 2023.11.09 |
---|---|
[LeetCode][SQL50] #12. Students and Examinations (0) | 2023.11.09 |
[LeetCode][SQL50] #10. Average Time of Process per Machine (0) | 2023.11.08 |
[LeetCode][SQL50] #9. Rising Temperature (0) | 2023.11.08 |
[LeetCode] (์๋ธ์ฟผ๋ฆฌ, ์กฐ์ธ ์๋) #8. Customer Who Visited but Did Not Make Any Transactions (1) | 2023.11.08 |