Creator Publishing Frequency

Easy Aggregation Twitter SQL

The creator_posts table has one row per post (tweet_id, user_id, tweet_date). Considering only posts dated in calendar year 2022, count how many posts each user published, then build a histogram: for every per-user post count (tweet_bucket), return how many users (users_num) published exactly that many posts. Users with no 2022 posts are not part of any bucket. Output columns: tweet_bucket, users_num. Order by tweet_bucket ascending.

Table: creator_posts

Schema of creator_posts
ColumnType
tweet_idINTEGER
user_idINTEGER
tweet_dateDATE
Sample rows of creator_posts
tweet_iduser_idtweet_date
10112022-01-10
10212022-02-15
10322022-03-20
10432022-04-11
10532022-05-12
10632022-06-13
Expected output on the sample data
tweet_bucketusers_num
11
21
31