CodingSpace

[HackerRank/SQL] Basic SELECT - Employee Salaries 본문

HackerRank/SQL

[HackerRank/SQL] Basic SELECT - Employee Salaries

개발자_조이킴 2022. 7. 1. 09:25

Problem. Basic SELECT - Employee Salaries


Link.

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


Description.

Write a query that prints a list of employee names (i.e.: the name attribute) for employees in Employee having a salary greater than  per month who have been employees for less than  months.

Sort your result by ascending employee_id.

 

Employee 테이블
Employee 테이블 예시


Key Point. 

SELECT,

 

WHERE,


My Answer. 

SELECT E.name
FROM Employee E
WHERE E.salary > 2000 AND E.months < 10;

References. 

 

Comments