[HackerRank] Employee Names

당당·2023년 7월 12일
0

HackerRank

목록 보기
2/27

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

📔문제

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

The Employee table containing employee data for a company is described as follows:

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 their monthly salary.


📝예시

Angela
Bonnie
Frank
Joe
Kimberly
Lisa
Michael
Patrick
Rose
Todd

🧮분야

  • SELECT

📃SQL 코드

select name
from employee
order by name;

📰출력 결과


📂고찰

단순히 이름을 select하고 이름순으로 정렬하면 된다.

profile
MySQL DBA 신입

0개의 댓글