Multi Reply Posts

Start Timer

0:00:00

Upvote
8
Downvote
Save question
View comments

We’re given an all_posts table of posts, where some posts are replies to other posts. Write a query to find the number of distinct post authors who had at least one of their posts receive 2 or more replies.

Note: A reply’s parent_post_id is the postid it is replying to. An original post has a NULL parent_post_id.

Example:

Input:

all_posts table

Column Type
postid INTEGER
post_author_id INTEGER
post_creation_date DATETIME
post_type VARCHAR
post_text TEXT
parent_post_id INTEGER

Output:

Column Type
num_authors INTEGER
.
.
.
.
.


Comments

Loading comments