본문 바로가기
일일 문제 풀이/HackerRank

[SQL] 해커랭크 HackerRank 문제 풀이 Employee Names 정답

by 엘리는 코딩 마스터 2025. 3. 9.

 

 

문제

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

 

employee 테이블에서  이름(name)을 알피벳 순으로 출력하라

 

정답

select name
from employee
order by name;

 

배운 점

기본적으로 order by 는 asc 오름차순이다 따라서 디폴트가 asc니까 굳이 안 적어도 된다.