MySQL Solution using Cross Join - 90.28%
Code\n\nSELECT a.machine_id, ROUND(AVG(b.timestamp - a.timestamp), 3) AS processing_time\nFROM Activity a, Activity b\nWHERE a.activity_type = \'start\' \n  AND
# Code\n```\nSELECT a.machine_id, ROUND(AVG(b.timestamp - a.timestamp), 3) AS processing_time\nFROM Activity a, Activity b\nWHERE a.activity_type = \'start\' \n  AND b.activity_type = \'end\'\n  AND a.machine_id = b.machine_id \n  AND a.process_id = b.process_id\nGROUP BY a.machine_id;\n```\n![laptop-cat.jpg](https://assets.leetcode.com/users/images/d6b89ae0-1c8f-4340-b3e1-b877c5762c72_1689187902.2983496.jpeg)\n
['MySQL']