8000 Update # 1303. Find the Team Size.sql · dana3601/Leetcode-Problems@f496a27 · GitHub
[go: up one dir, main page]

Skip to content

Commit f496a27

Browse files
authored
Update # 1303. Find the Team Size.sql
1 parent 35fb3b4 commit f496a27

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

Schools and Organizations/# 1303. Find the Team Size.sql

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,8 +15,8 @@ FROM Employee e
1515
;
1616

1717

18-
19-
# Use LEFT JOIN to self-join; Don't forgot to use GROUP BY
< 4DEB code>18+
# Use SELF-JOIN; Don't forgot to use GROUP BY
19+
# Why need 2 tables - It's basically used where there is any relationship between rows stored in the same table (correlate pairs of rows from the same table)
2020
select e1.employee_id,count(*) team_size
2121
from employee e1 left join employee e2on e1.team_id = e2.team_id
2222
group by e1.employee_id;

0 commit comments

Comments
 (0)
0