Amazon Services operations leaders need to identify recurring shift patterns whose productivity remains below target. Write a PostgreSQL query that evaluates each shift date against a rolling 30-day window.
| Column | Type | Description |
|---|---|---|
| shift_idPK | INT | Shift assignment identifier |
| site_id | INT | Amazon Services site identifier |
| shift_code | VARCHAR(20) | Shift classification |
| shift_date | DATE | Date on which the shift operated |
| Column | Type | Description |
|---|---|---|
| productivity_idPK | INT | Productivity record identifier |
| shift_id | INT | Related shift assignment |
| units_completed | INT | Units completed during the record interval |
| labor_hours | NUMERIC(8,2) | Labor hours recorded for the interval |
| Column | Type | Description |
|---|---|---|
| site_idPK | INT | Amazon Services site identifier |
| shift_codePK | VARCHAR(20) | Shift classification |
| target_units_per_hour | NUMERIC(8,2) | Required units per labor hour |