Prepare > SQL > Basic Select > Employee Salaries
2023. 7. 14. 19:53ㆍHackerRank-My SQL
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.
코드
SELECT NAME FROM EMPLOYEE
WHERE salary > 2000 AND months < 10;
두 번째 시도
SELECT NAME FROM EMPLOYEE
WHERE SALARY > 2000 AND MONTHS < 10
ORDER BY EMPLOYEE_ID;
'HackerRank-My SQL' 카테고리의 다른 글
Prepare > SQL > Advanced Select > Type of Triangle (0) | 2023.07.15 |
---|---|
Prepare > SQL > Basic Select > Employee Names (0) | 2023.07.14 |
Prepare > SQL > Basic Select > Weather Observation Station 12 (0) | 2023.07.13 |
Prepare > SQL > Basic Select > Weather Observation Station 11 (0) | 2023.07.13 |
Prepare > SQL > Basic Select > Weather Observation Station 10 (0) | 2023.07.13 |