✅ 100% EASY || FAST 🔥|| CLEAN 2️⃣  SOLUTION 🌟
IF THIS WILL BE HELPFUL TO YOU, PLEASE UPVOTE !\n\n# Code1\n\n/* Write your PL/SQL query statement below */\nSELECT A1.machine_id, ROUND(AVG(A2.timestamp - A1.t
IF THIS WILL BE HELPFUL TO YOU, PLEASE UPVOTE !\n\n# Code1\n```\n/* Write your PL/SQL query statement below */\nSELECT A1.machine_id, ROUND(AVG(A2.timestamp - A1.timestamp),3) As \n\nprocessing_time FROM Activity A1, Activity A2 WHERE \n\nA1.machine_id = A2.machine_id AND A1.process_id = A2.process_id \n\nAND A1.timestamp < A2.timestamp GROUP BY A1.machine_id\n\n\n```\n\n# Code2\n```\n/* Write your PL/SQL query statement below */\nSELECT A.machine_id, ROUND(( SELECT AVG(A1.timestamp) FROM Activity A1\n\nWHERE A1.activity_type=\'end\' AND A1.machine_id = A.machine_id) -  \n\n( SELECT AVG(A1.timestamp) FROM Activity A1 WHERE \n\nA1.activity_type=\'start\' AND A1.machine_id = A.machine_id), 3) AS \n\nprocessing_time FROM Activity A GROUP BY A.machine_id\n```\n\n![5kej8w.jpg](https://assets.leetcode.com/users/images/2f9cf237-bad8-4dbf-b421-b227f9fbc79e_1691140207.4912024.jpeg)\n
['Database', 'Oracle']