Solution Using AVG, ROUND
\'\'\'\nSELECT machine_id, ROUND((AVG(CASE WHEN activity_type = \'end\' THEN timestamp ELSE NULL END))-AVG((CASE WHEN activity_type = \'start\' THEN timestamp E
\'\'\'\nSELECT machine_id, ROUND((AVG(CASE WHEN activity_type = \'end\' THEN timestamp ELSE NULL END))-AVG((CASE WHEN activity_type = \'start\' THEN timestamp ELSE NULL END)), 3) AS processing_time\nFROM Activity\nGROUP BY machine_id\n\'\'\'
[]