Lim Seunghyun Space

[HackerRank] Employee Salaries 본문

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

'SQL > SQL 문제' 카테고리의 다른 글

[HackerRank] Type of Triangle  (0) 2021.11.30
[HackerRank] The PADS  (0) 2021.11.29
[HackerRank] Employee Names  (0) 2021.11.22
[HackerRank] Weather Observation Station 12  (0) 2021.11.21
[HackerRank] Weather Observation Station 11  (0) 2021.11.21