Welcome to the SQL screen.
The question is on your right: Detect Sudden Reviewer Accuracy Drops. Read through the requirements and the one table first.
Run and submit your code as often as you need. You also have five interviewer messages this session - want to talk through your approach, or are you ready to start coding?
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 |