✨SQL
\n Add your space complexity here, e.g. O(n) \n\n# Code\n\nselect a.machine_id ,round(avg(b.timestamp-a.timestamp),3) as processing_time \nfrom Activity a join 
\n<!-- Add your space complexity here, e.g. $$O(n)$$ -->\n\n# Code\n```\nselect a.machine_id ,round(avg(b.timestamp-a.timestamp),3) as processing_time \nfrom Activity a join Activity b on a.machine_id= b.machine_id and a.process_id=b.process_id \nwhere a.activity_type=\'start\' and b.activity_type=\'end\'\ngroup by machine_id \n\n```
['MySQL']