Loading problem...
Your moderation analytics pipeline stores user events in content_actions and final takedown decisions in removed_posts.
Table: content_actions
Table: removed_posts
Task:
Precise metric definition:
Important notes:
Return exactly one row with one column:
Supported submission environments:
content_actions:
| user_id | post_id | action_date | action | reason |
|---------|---------|-------------|--------|--------|
| 1 | 101 | 2025-01-01 | report | spam |
| 2 | 102 | 2025-01-01 | report | spam |
| 3 | 102 | 2025-01-01 | report | spam |
| 4 | 104 | 2025-01-02 | report | spam |
| 5 | 105 | 2025-01-02 | report | spam |
| 6 | 105 | 2025-01-02 | comment| spam |
| 7 | 106 | 2025-01-03 | report | abuse |
removed_posts:
| post_id | removed_on |
|---------|-------------|
| 101 | 2025-01-09 |
| 102 | 2025-01-10 |
| 104 | 2025-01-11 |[
{"average_daily_percent":75.0}
]Eligible days are 2025-01-01 and 2025-01-02. Day 1 has distinct spam posts {101,102} and both are removed => 100%. Day 2 has {104,105} and only 104 is removed => 50%. Average is (100 + 50) / 2 = 75.00.
content_actions:
| user_id | post_id | action_date | action | reason |
|---------|---------|-------------|--------|--------|
| 10 | 900 | 2025-02-01 | report | abuse |
| 11 | 901 | 2025-02-01 | view | null |
| 12 | 902 | 2025-02-02 | comment| spam |
removed_posts:
| post_id | removed_on |
|---------|-------------|
| 900 | 2025-02-10 |
| 902 | 2025-02-10 |[
{"average_daily_percent":null}
]There are no rows where action='report' and reason='spam', so there are no eligible days and the metric is NULL.
content_actions:
| user_id | post_id | action_date | action | reason |
|---------|---------|-------------|--------|--------|
| 30 | 201 | 2025-03-01 | report | spam |
| 31 | 202 | 2025-03-01 | report | spam |
| 32 | 201 | 2025-03-02 | report | spam |
removed_posts:
| post_id | removed_on |
|---------|-------------|
| 201 | 2025-03-08 |[
{"average_daily_percent":75.0}
]On 2025-03-01, 1 of 2 distinct spam-reported posts was removed => 50%. On 2025-03-02, 1 of 1 was removed => 100%. Average is 75.00.
Constraints