코린이의 소소한 공부노트

[LeetCode/Easy] 1378. Replace Employee ID With The Unique Identifier 본문

코딩테스트 풀이/SQL

[LeetCode/Easy] 1378. Replace Employee ID With The Unique Identifier

무지맘 2023. 4. 11. 16:30

1. Input

1) Table: Employees (pk: id)

2) Table: EmployeeUNI (pk: (id, unique_id))

 

2. Output

1) unique_id와 이름을 출력한다.

- unique_id가 없을 경우 null을 출력한다.

- 출력 순서는 상관 없다.

 

3. Example

 

4. Code

1) 첫 코드(2023/04/11)

select u.unique_id, e.name
from Employees e
left outer join EmployeeUNI u on e.id = u.id