577. Employee Bonus
https://leetcode.com/problems/employee-bonus/
Employee Bonus - LeetCode
Can you solve this real interview question? Employee Bonus - Level up your coding skills and quickly land a job. This is the best place to expand your knowledge and get prepared for your next interview.
leetcode.com
Write an SQL query to report the name and bonus amount of each employee with a bonus less than 1000.
# 1
SELECT name, bonus
FROM Employee E LEFT JOIN Bonus B USING(empID)
WHERE bonus < 1000 or bonus IS NULL;
# 2
SELECT name, bonus
FROM Employee LEFT JOIN Bonus USING(empId)
WHERE COALESCE(bonus, 0) < 1000;
'🛠️Skill > CodingTest' 카테고리의 다른 글
[leetcode] 550. Game Play Analysis IV/ 이틀 연속 로그인한 유저 /LEFT JOIN/IN (0) | 2023.02.19 |
---|---|
[leetcode] 1164. Product Price at a Given Date / 지정 날짜에 변경된 데이터 조회 / UNION (0) | 2023.02.17 |
[leetcode] 1158. Market Analysis I / CASE WHEN, IFNULL (0) | 2022.12.30 |
[프로그래머스] Lv4. 저자 별 카테고리 별 매출액 집계하기 (0) | 2022.12.18 |
[프로그래머스] Lv2.조건에 맞는 도서와 저자 리스트 출력/Lv3. 카테고리 별 도서 판매량 집계 (0) | 2022.12.16 |
댓글