Write a SQL query to calculate daily throughput, average cycle time, and backlog by shop location from production tables.
Use the provided production job and shop location data. Treat throughput as jobs completed on a date, cycle time as the elapsed time from job start to completion, and backlog as jobs started but not completed by the end of that date.
location_name, report_date, daily_throughput, average_cycle_time, and backlog.| Column | Type | Description |
|---|---|---|
| shop_idPK | INT | Unique production shop identifier |
| location_name | VARCHAR(100) | Shop location name |
| Column | Type | Description |
|---|---|---|
| job_idPK | INT | Unique production job identifier |
| shop_id | INT | Shop assigned to the job |
| started_at | TIMESTAMP | Timestamp when production started |
| completed_at | TIMESTAMP | Timestamp when production completed |