Write a SQL query to analyze production performance by plant, line, and week, including output, defect rate, and on-time delivery rate.
Use the provided production, line, and delivery data. Include production weeks with no delivery records, and treat missing defect or delivery-status values appropriately.
Output
- One row per plant, line, and calendar week
- Columns:
plant_name, line_name, week_start, total_output, defect_rate_pct, and on_time_delivery_rate_pct
- Include all production groups, order by plant, line, and week, and round percentage values to two decimal places