Skip to content

Commit 36553b0

Browse files
add 1789
1 parent 258ccad commit 36553b0

File tree

2 files changed

+6
-0
lines changed

2 files changed

+6
-0
lines changed

database/_1789.sql

+5
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
-- # Write your MySQL query statement below
2+
select employee_id, department_id
3+
from (select *, count(employee_id) over(partition by employee_id) as EmployeeCount from Employee) EP
4+
where EmployeeCount = 1
5+
or primary_flag = 'Y';

paginated_contents/database/README.md

+1
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22
|------|----------------|-----------------------------------------------------------------------------------------------------------------------|---------------|---------------|-------------
33
| 3198 |[Find Cities in Each State](https://leetcode.com/problems/find-cities-in-each-state/)| [Solution](https://github.com/fishercoder1534/Leetcode/blob/master/database/_3198.sql) || Easy |
44
| 3172 |[Second Day Verification](https://leetcode.com/problems/second-day-verification/)| [Solution](https://github.com/fishercoder1534/Leetcode/blob/master/database/_3172.sql) || Easy |
5+
| 1789 |[Primary Department for Each Employee](https://leetcode.com/problems/primary-department-for-each-employee/)| [Solution](https://github.com/fishercoder1534/Leetcode/blob/master/database/_1789.sql) || Easy |
56
| 1757 |[Recyclable and Low Fat Products](https://leetcode.com/problems/recyclable-and-low-fat-products/)| [Solution](https://github.com/fishercoder1534/Leetcode/blob/master/database/_1757.sql) || Easy |
67
| 1741 |[Find Total Time Spent by Each Employee](https://leetcode.com/problems/find-total-time-spent-by-each-employee/)| [Solution](https://github.com/fishercoder1534/Leetcode/blob/master/database/_1741.sql) || Easy |
78
| 1729 |[Find Followers Count](https://leetcode.com/problems/find-followers-count/)| [Solution](https://github.com/fishercoder1534/Leetcode/blob/master/database/_1729.sql) || Easy |

0 commit comments

Comments
 (0)