SQL/SQL 문제
[HackerRank] Employee Salaries
Lim Seung Hyun
2021. 11. 22. 16:39
문제 : https://www.hackerrank.com/challenges/salary-of-employees/problem?isFullScreen=true
Employee Salaries | HackerRank
Print the names of employees who earn more than $2000 per month and have worked at the company for less than 10 months.
www.hackerrank.com
문제 해설
- Employee 테이블에서 10개월 미만 근무자 중 salary가 2000보다 큰 name을 조회
- 결과는 employee_id를 오른차순으로 정렬한 결과
나의 풀이 (MySQL)
SELECT name
FROM Employee
WHERE salary > 2000 and months < 10
ORDER BY employee_id;
728x90