Flagged Posts
A social-network moderation team investigates the breakdown of reports on one day. Each row in Actions is a user action on a post: view, like, share, report or remove. The action type lives in the ENUM column action; for action = 'report' rows the reason is stored in a separate ENUM column report_reason (values: spam, racism, violence, nudity, misinformation, other). The action moment is acted_at TIMESTAMPTZ, the IP is INET, extra metadata sits in JSONB action_payload.
For 2024-07-04 count, per reason, the number of unique reported posts.
Result columns: report_reason, report_count. Sort by report_reason.
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.
| report_count | report_reason |
|---|---|
| 4 | spam |
| 2 | racism |
| 1 | violence |
Sign in to see submission history
Sign inSign in to use AI Mentor
Sign in