Mysql #easycode
Intuition\n Describe your first thoughts on how to solve this problem. \n\n# Approach\n Describe your approach to solving the problem. \n\n# Complexity\n- Time 
# Intuition\n<!-- Describe your first thoughts on how to solve this problem. -->\n\n# Approach\n<!-- Describe your approach to solving the problem. -->\n\n# Complexity\n- Time complexity:\n<!-- Add your time complexity here, e.g. $$O(n)$$ -->\n\n- Space complexity:\n<!-- Add your space complexity here, e.g. $$O(n)$$ -->\n\n# Code\n```\n# Write your MySQL query statement below\nselect a1.machine_id, round(avg(a2.timestamp-a1.timestamp), 3) as processing_time \nfrom Activity a1\njoin Activity a2 \non a1.machine_id=a2.machine_id and a1.process_id=a2.process_id\nand a1.activity_type=\'start\' and a2.activity_type=\'end\'\ngroup by a1.machine_id\n```
['MySQL']