Can you write a SQL query to find the average time taken to complete operational tasks at Okta?
Use the provided Okta operational task data. Include only completed tasks with both start and completion timestamps, and report results by task type.
task_type, average_minutes, and completed_task_countaverage_minutes descending, then task_type ascending for ties| Column | Type | Description |
|---|---|---|
| task_type_idPK | INT | Unique identifier for an operational task type |
| task_type_name | VARCHAR(100) | Readable name of the operational task type |
| Column | Type | Description |
|---|---|---|
| task_idPK | INT | Unique identifier for an operational task |
| task_type_id | INT | References the operational task type |
| status | VARCHAR(20) | Current task status |
| started_at | TIMESTAMP | Timestamp when task processing started |
| completed_at | TIMESTAMP | Timestamp when task processing completed |