Write a SQL query to find the top three performing production lines by yield percentage over the last quarter at MilliporeSigma.
Use the production_lines and production_runs tables. Yield percentage is total good units divided by total produced units, multiplied by 100. The last quarter means the previous calendar quarter relative to the query execution date.
line_id, line_name, and yield_percentage.yield_percentage descending, then line_id ascending to break ties.| Column | Type | Description |
|---|---|---|
| line_idPK | INT | Unique production line identifier |
| line_name | VARCHAR(100) | Production line name |
| site_name | VARCHAR(100) | MilliporeSigma manufacturing site |
| product_family | VARCHAR(100) | Primary product family manufactured by the line |
| Column | Type | Description |
|---|---|---|
| run_idPK | INT | Unique production run identifier |
| line_id | INT | Production line associated with the run |
| production_date | DATE | Date on which the run was completed |
| produced_units | INT | Total units produced during the run |
| good_units | INT | Units meeting quality requirements |