본문 바로가기

SQL/HackerRank

[MySQL/HackerRank] Employee Names

Question

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

Input Format

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.

Sample Input

Sample Output

Angela
Bonnie
Frank
Joe
Kimberly
Lisa
Michael
Patrick
Rose
Todd

My Answer

select name 
from employee
order by name;

Result

전체 결과는 아래 더보기를 클릭하여 확인 가능합니다.

더보기
Alan 
Amy 
Andrew 
Andrew 
Angela 
Ann 
Anna 
Anthony 
Antonio 
Benjamin 
Bonnie 
Brandon 
Brandon 
Brian 
Carol 
Charles 
Christina 
Christina 
Christine 
Christine 
David 
David 
David 
Debra 
Diana 
Diana 
Donna 
Dorothy 
Dorothy 
Dorothy 
Earl 
Elizabeth 
Emily 
Evelyn 
Evelyn 
Frank 
Gerald 
Gloria 
Gregory 
Harry 
Jacqueline 
James 
James 
Jean 
Jennifer 
Jesse 
Jesse 
Joe 
Joe 
John 
John 
Jonathan 
Joseph 
Joyce 
Joyce 
Julia 
Keith 
Kelly 
Kevin 
Kimberly 
Kimberly 
Lawrence 
Lillian 
Linda 
Lisa 
Lori 
Louise 
Maria 
Marilyn 
Marilyn 
Marilyn 
Martha 
Martin 
Matthew 
Melissa 
Michael 
Michelle 
Nancy 
Norma 
Pamela 
Patricia 
Patrick 
Paul 
Paul 
Paula 
Paula 
Phillip 
Ralph 
Robert 
Robin 
Robin 
Rose 
Roy 
Stephanie 
Tammy 
Timothy 
Todd 
Victor 
Walter 
Willie

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

 

Employee Names | HackerRank

Print employee names.

www.hackerrank.com