Uber safety and quality teams monitor driver ratings to ensure a premium experience. They need to identify drivers who might need additional training or warnings because their average rating from trips in the last 7 days has fallen below 4.0.
Write an SQL query to find these drivers.
| driver_id(INTEGER) | rating(DECIMAL) | trip_completed_at(TIMESTAMP) |
|---|---|---|
| 101 | 3 | 2026-02-10 10:00:00 |
| 101 | 3.5 | 2026-02-09 12:00:00 |
| 102 | 5 | 2026-02-10 08:00:00 |
| 103 | 2 | 2026-02-08 15:00:00 |
| 103 | 5 | 2026-02-01 09:00:00 |
| 104 | 4.5 | 2026-02-07 11:00:00 |
| driver_id(INTEGER) | avg_rating(DECIMAL) |
|---|---|
| 103 | 2 |
| 101 | 3.25 |