Write a SQL query to identify the top-performing manufacturing lines based on monthly throughput and error rates.
Use the provided manufacturing line and production record data. Return the two highest-throughput lines for each month with their calculated error rates and performance rank.
month_start, line_name, monthly_throughput, error_rate_pct, and performance_rank.month_start, then performance_rank, then line_name.| Column | Type | Description |
|---|---|---|
| line_idPK | INT | Unique manufacturing line identifier |
| line_name | VARCHAR(100) | Manufacturing line name |
| facility_code | VARCHAR(20) | Facility code where the line operates |
| Column | Type | Description |
|---|---|---|
| record_idPK | INT | Unique production record identifier |
| line_id | INT | Manufacturing line associated with the record |
| production_date | DATE | Date of production activity |
| units_completed | INT | Number of units completed |
| error_count | INT | Number of production errors |