Comments Under Posts
For each post (rows where parent_id IS NULL) count the number of unique comments. Return post_id and number_of_comments.
Expected output sample
This is what a correct answer looks like — its row count is its own, it doesn't have to match the schema tables.
| post_id | number_of_comments |
|---|---|
| 1 | 3 |
| 2 | 2 |
| 3 | 1 |
Sign in to see submission history
Sign inSign in to use AI Mentor
Sign in