Your question is Detect Sudden Reviewer Accuracy Drops. Start with the requirements and the one table on the right.
Run and submit as often as you like. When you're ready, talk me through your approach or go straight to the code.
You are given review outcomes for a set of reviewers. Write a PostgreSQL query that flags the first day each reviewer’s accuracy drops by at least 20 percentage points compared with the previous review day, and returns the reviewer, the date of the drop, the prior day’s accuracy, the current day’s accuracy, and the size of the drop.
Use only the data in the table below. Treat accuracy as correct_reviews / total_reviews, and ignore rows where total_reviews = 0 when calculating accuracy. Return one row per reviewer for the first qualifying drop, ordered by the largest drop first.
| Column | Type | Description |
|---|---|---|
| reviewer_id | INT | Reviewer identifier |
| reviewer_name | VARCHAR(100) | Reviewer display name |
| review_date | DATE | Date of the review batch |
| correct_reviews | INT | Number of correct reviews on that day |
| total_reviews | INT | Total reviews completed that day |