In Line Explanation || Beats 100% || Using JOIN
Approach\nIn Line Explanation\n\n# Complexity\n- Time complexity: Beyond your expactation :)\n Add your time complexity here, e.g. O(n) \n\n# Code\nmysql [MySQL
# Approach\nIn Line Explanation\n\n# Complexity\n- Time complexity: Beyond your expactation :)\n<!-- Add your time complexity here, e.g. $$O(n)$$ -->\n\n# Code\n```mysql [MySQL If You Like My Solution Please Give Me Upvote :)]\n# first of all we have activity table only\n# then we copy activity table in a and b so now we have 3 table a, b, activity\n# ignore activity table\n# we need machine_id and timestamp in output\n# but time stamp i need average of end - start and for all machine of same machine id\n# that column name we put processing_time\n   SELECT  a.machine_id, ROUND(AVG(b.timestamp-a.timestamp),3) AS processing_time  \n# from activity a means in a table\n   FROM Activity a\n# join with b table\n    JOIN Activity b\n# now we have condition that both maching_id i want same\n        ON a.machine_id = b.machine_id \n# now in where i have 2 condition\n# process_id of a and b table i want same\n# activity_type i will take in a is start and in b is end\n        WHERE a.process_id=b.process_id AND a.activity_type=\'start\' AND b.activity_type=\'end\'\n# i will group by from machine_id\n        GROUP BY a.machine_id;\n```
['Database', 'MySQL']