File tree Expand file tree Collapse file tree 2 files changed +42
-0
lines changed
Expand file tree Collapse file tree 2 files changed +42
-0
lines changed Original file line number Diff line number Diff line change @@ -49,6 +49,7 @@ Have a good contributing!
4949 - [ 620. Not Boring Movies] ( ./leetcode/easy/620.%20Not%20Boring%20Movies.sql )
5050 - [ 1068. Product Sales Analysis I] ( ./leetcode/easy/1068.%20Product%20Sales%20Analysis%20I.sql )
5151 - [ 1327. List the Products Ordered in a Period] ( ./leetcode/easy/1327.%20List%20the%20Products%20Ordered%20in%20a%20Period.sql )
52+ - [ 1378. Replace Employee ID With The Unique Identifier] ( ./leetcode/easy/1378.%20Replace%20Employee%20ID%20With%20The%20Unique%20Identifier.sql )
5253 - [ 1407. Top Travellers] ( ./leetcode/easy/1407.%20Top%20Travellers.sql )
5354 - [ 1484. Group Sold Products By The Date] ( ./leetcode/easy/1484.%20Group%20Sold%20Products%20By%20The%20Date.sql )
5455 - [ 1587. Bank Account Summary II] ( ./leetcode/easy/1587.%20Bank%20Account%20Summary%20II.sql )
Original file line number Diff line number Diff line change 1+ /*
2+ Question 1378. Replace Employee ID With The Unique Identifier
3+ Link: https://leetcode.com/problems/replace-employee-id-with-the-unique-identifier/description/
4+
5+ Table: Employees
6+
7+ +---------------+---------+
8+ | Column Name | Type |
9+ +---------------+---------+
10+ | id | int |
11+ | name | varchar |
12+ +---------------+---------+
13+ id is the primary key (column with unique values) for this table.
14+ Each row of this table contains the id and the name of an employee in a company.
15+
16+
17+ Table: EmployeeUNI
18+
19+ +---------------+---------+
20+ | Column Name | Type |
21+ +---------------+---------+
22+ | id | int |
23+ | unique_id | int |
24+ +---------------+---------+
25+ (id, unique_id) is the primary key (combination of columns with unique values) for this table.
26+ Each row of this table contains the id and the corresponding unique id of an employee in the company.
27+
28+
29+ Write a solution to show the unique ID of each user, If a user does not have a unique ID replace just show null.
30+
31+ Return the result table in any order.
32+ */
33+
34+ SELECT
35+ eu .unique_id ,
36+ e .name
37+ FROM Employees AS e
38+ LEFT JOIN
39+ EmployeeUNI AS eu
40+ ON e .id = eu .id
41+
You can’t perform that action at this time.
0 commit comments