SELECT
statement to specify the columns to be retrieved, which are user_id
and the count of followers (aliased as followers_count
).FROM
clause to specify the Followers
table as the source of the data.GROUP BY
clause to group the results by user_id
, which will allow the COUNT
function to calculate the number of followers for each user.ORDER BY
clause to sort the results by user_id
in ascending order.erDiagram Followers { int user_id int follower_id user_id & follower_id PK }