Skip to content

Commit 811ea36

Browse files
committed
feat: add sql solution to lc problem: No.1729. Find Followers Count
1 parent 1d0de1a commit 811ea36

File tree

3 files changed

+30
-5
lines changed

3 files changed

+30
-5
lines changed

solution/1700-1799/1729.Find Followers Count/README.md

+12-3
Original file line numberDiff line numberDiff line change
@@ -49,17 +49,26 @@
4949

5050
<p> </p>
5151

52-
5352
## 解法
5453

5554
<!-- 这里可写通用的实现逻辑 -->
5655

56+
`GROUP BY` 实现。
57+
5758
<!-- tabs:start -->
5859

5960
### **SQL**
6061

6162
```sql
62-
63+
# Write your MySQL query statement below
64+
SELECT
65+
user_id, count(1) AS followers_count
66+
FROM
67+
Followers
68+
GROUP BY
69+
user_id
70+
ORDER BY
71+
user_id
6372
```
6473

65-
<!-- tabs:end -->
74+
<!-- tabs:end -->

solution/1700-1799/1729.Find Followers Count/README_EN.md

+9-2
Original file line numberDiff line numberDiff line change
@@ -49,15 +49,22 @@ The followers of 2 are {0,1}
4949

5050
<p>&nbsp;</p>
5151

52-
5352
## Solutions
5453

5554
<!-- tabs:start -->
5655

5756
### **SQL**
5857

5958
```sql
60-
59+
# Write your MySQL query statement below
60+
SELECT
61+
user_id, count(1) AS followers_count
62+
FROM
63+
Followers
64+
GROUP BY
65+
user_id
66+
ORDER BY
67+
user_id
6168
```
6269

6370
<!-- tabs:end -->
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
# Write your MySQL query statement below
2+
SELECT
3+
user_id, count(1) AS followers_count
4+
FROM
5+
Followers
6+
GROUP BY
7+
user_id
8+
ORDER BY
9+
user_id;

0 commit comments

Comments
 (0)