코딩 테스트 연습/[프로그래머스][리트코드] MySQL

1378. Replace Employee ID With The Unique Identifier

duswjd_data 2025. 8. 13. 09:01

문제

https://leetcode.com/problems/replace-employee-id-with-the-unique-identifier/description/


문제 설명

  • 두 개의 테이블이 주어졌을 때,
    • Employees (컬럼 : id, name)
    • EmployeeUN (컬럼 : id, unique_id)
  • 모든 직원의 unique_id와 name을 출력
    • unique_id가 없는 경우 null을 출력

정답 코드

SELECT u.unique_id, e.name
FROM employees AS e LEFT JOIN employeeuni AS u on e.id = u.id