MySQL solution - no join, a simple groupby
\n# Write your MySQL query statement below\nselect machine_id, \nround(sum(case when activity_type = \'end\' then `timestamp` else -`timestamp` end) / \ncount(d
```\n# Write your MySQL query statement below\nselect machine_id, \nround(sum(case when activity_type = \'end\' then `timestamp` else -`timestamp` end) / \ncount(distinct process_id),3) as processing_time\nfrom Activity\ngroup by machine_id\n\n```
[]