File tree Expand file tree Collapse file tree 2 files changed +28
-0
lines changed
Expand file tree Collapse file tree 2 files changed +28
-0
lines changed Original file line number Diff line number Diff line change @@ -50,6 +50,7 @@ Have a good contributing!
5050 - [ 1068. Product Sales Analysis I] ( ./leetcode/easy/1068.%20Product%20Sales%20Analysis%20I.sql )
5151 - [ 1407. Top Travellers] ( ./leetcode/easy/1407.%20Top%20Travellers.sql )
5252 - [ 1484. Group Sold Products By The Date] ( ./leetcode/easy/1484.%20Group%20Sold%20Products%20By%20The%20Date.sql )
53+ - [ 1729. Find Followers Count] ( ./leetcode/easy/1729.%20Find%20Followers%20Count.sql )
53542 . [ Medium] ( ./leetcode/medium/ )
5455 - [ 176. Second Highest Salary] ( ./leetcode/medium/176.%20Second%20Highest%20Salary.sql )
5556 - [ 184. Department Highest Salary] ( ./leetcode/medium/184.%20Department%20Highest%20Salary.sql )
Original file line number Diff line number Diff line change 1+ /*
2+ Question 1729. Find Followers Count
3+ Link: https://leetcode.com/problems/find-followers-count/description/
4+
5+ Table: Followers
6+
7+ +-------------+------+
8+ | Column Name | Type |
9+ +-------------+------+
10+ | user_id | int |
11+ | follower_id | int |
12+ +-------------+------+
13+ (user_id, follower_id) is the primary key (combination of columns with unique values) for this table.
14+ This table contains the IDs of a user and a follower in a social media app where the follower follows the user.
15+
16+
17+ Write a solution that will, for each user, return the number of followers.
18+
19+ Return the result table ordered by user_id in ascending order.
20+ */
21+
22+ SELECT
23+ user_id,
24+ COUNT (user_id) AS followers_count
25+ FROM Followers
26+ GROUP BY user_id
27+ ORDER BY user_id
You can’t perform that action at this time.
0 commit comments