Flagged Posts
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.
report_reason is an ENUM, so ORDER BY report_reason sorts by the declaration order of its values (listed above), not alphabetically.
Row order matters
Sign in to see submission history
Sign inSign in to use AI Mentor
Sign in