일 | 월 | 화 | 수 | 목 | 금 | 토 |
---|---|---|---|---|---|---|
1 | ||||||
2 | 3 | 4 | 5 | 6 | 7 | 8 |
9 | 10 | 11 | 12 | 13 | 14 | 15 |
16 | 17 | 18 | 19 | 20 | 21 | 22 |
23 | 24 | 25 | 26 | 27 | 28 |
- Sigmoid
- select
- affine
- stak
- Programmers
- Python
- hash
- 파이썬
- boj
- Heap
- PPMI
- 딥러닝
- Word2vec
- MySQL
- sort
- 프로그래머스
- 신경망
- SQL
- 자연어처리
- kakao
- CBOW
- skip-gram
- algorithm
- que
- Stack
- DeepLearning
- FullyConnectedLayer
- Numpy
- dl
- backward
- Today
- Total
혜온의 이것저것
[HackerRank] Employee Salaries (MySQL) 본문
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
문제
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.
Input Format
The Employee table containing employee data for a company is described as follows:
![](https://blog.kakaocdn.net/dn/bZ1DO4/btrJj5JSiOC/8b2o4kc5k6jxemjJKHsZq0/img.png)
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.
Sample Input
![](https://blog.kakaocdn.net/dn/djwFu3/btrJfqPuSOS/KBqWwGOqpR8ActEs1WCA7K/img.png)
Sample Output
Angela
Michael
Todd
Joe
Explanation
Angela has been an employee for 1 month and earns &3443 per month.
Michael has been an employee for 6 months and earns $2017 per month.
Todd has been an employee for 5 months and earns $3396 per month.
Joe has been an employee for 9 months and earns $3573 per month.
We order our output by ascending employee_id.
풀이
select name from employee
where months < 10 and salary > 2000
order by employee_id
'Data Analysis > SQL' 카테고리의 다른 글
[HackerRank] The PADS (MySQL) (0) | 2022.08.10 |
---|---|
[HackerRank] Type of Triangle (MySQL) (0) | 2022.08.10 |
[HackerRank] Employee Names (MySQL) (0) | 2022.08.09 |
[HackerRank] Higher Than 75 Marks (MySQL) (0) | 2022.08.09 |
[HackerRank] Weather Observation Station 12 (MySQL) (0) | 2022.08.09 |