[해커랭크] Basic 3문제

june·2023년 3월 19일
0

SQL

목록 보기
6/31

Higher Than 75 Marks

https://www.hackerrank.com/challenges/more-than-75-marks

  • Query the Name of any student in STUDENTS who scored higher than Marks. Order your output by the last three characters of each name. If two or more students both have names ending in the same last three characters (i.e.: Bobby, Robby, etc.), secondary sort them by ascending ID.
SELECT name
FROM students
WHERE marks > 75
ORDER BY RIGHT(name, 3), id

Employee Names

https://www.hackerrank.com/challenges/name-of-employees

  • Write a query that prints a list of employee names (i.e.: the name attribute) from the Employee table in alphabetical order.
SELECT name
FROM employee
ORDER BY name

Employee Salaries

https://www.hackerrank.com/challenges/salary-of-employees

  • 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 months < 10
    AND salary > 2000
ORDER BY employee_id
profile
나의 계절은

0개의 댓글