Given a table of production logs, how would you identify the top three equipment failures using a window function?
Use the production_logs table and consider only rows representing failures with a non-null failure code.
failure_code, failure_count, and failure_rank.failure_rank ascending, then failure_code ascending, and include ties at the third rank.| Column | Type | Description |
|---|---|---|
| log_idPK | INT | Unique production log identifier |
| equipment_id | VARCHAR(30) | Equipment that generated the log |
| failure_code | VARCHAR(40) | Categorized equipment failure code |
| event_type | VARCHAR(20) | Type of production event |
| logged_at | TIMESTAMP | Time when the event was recorded |
| failure_duration_minutes | INT | Duration of the failure in minutes |