
You are asked to write a PostgreSQL query that measures moderation pressure across Discord servers. For each server snapshot on 2024-06-30, return the number of abuse reports, the number of bans, the active user count, and the ratio of abuse reports to active users. Only include servers with at least 100 active users, and sort from highest ratio to lowest.
| Column | Type | Description |
|---|---|---|
| server_id | ||
| server_name | ||
| active_users | ||
| snapshot_date |
| Column | Type | Description |
|---|---|---|
| report_id | ||
| server_id | ||
| report_type | ||
| reported_at |
| Column | Type | Description |
|---|---|---|
| ban_id | ||
| server_id | ||
| banned_user_id | ||
| banned_at |
Only `report_type = 'abuse'` should count toward the numerator.Servers with no abuse reports or no bans should still appear if they meet the active-user threshold.Avoid double counting when combining reports and bans.Use the server snapshot as the denominator source.