문제 Employee Salaries
Write a query that prints a list of employee names (i.e.: the name attribute) for employees in Employee having a salary greater than $2000 per month who have been employees for less than 10 months. Sort your result by ascending employee_id.
where employee_id is an employee's ID number, name is their name, months is the total number of months they've been working for the company, and salary is the their monthly salary.
주어진 Employee 테이블에서 다음 조건을 만족하는 직원들의 이름을 조회하는 SQL 쿼리를 작성해야 합니다.
- **급여(salary)**가 월 2,000달러 초과인 직원
- **근무 기간(months)**이 10개월 미만인 직원
- 결과를 employee_id(직원 ID) 기준 오름차순(ascending) 정렬
정답
select name
from employee
where salary > 2000 and months < 10
order by employee_id;
배운 점
greater than 이 초과
less than 이 미만
'일일 문제 풀이 > HackerRank' 카테고리의 다른 글
[SQL] 해커랭크 HackerRank The PADS 문제 풀이 (0) | 2025.03.12 |
---|---|
[SQL] 해커랭크 HackerRank 문제 풀이 Type of Triangle - Advanced Select (0) | 2025.03.11 |
[SQL] 해커랭크 HackerRank 문제 풀이 Employee Names 정답 (0) | 2025.03.09 |
[SQL] 해커랭크 HackerRank 문제 풀이 Higher Than 75 Marks (0) | 2025.03.08 |
[SQL] HackerRank 해커랭크 문제 풀이 Weather Observation Station 12 (0) | 2025.03.07 |