Solution and walkthrough of leetcode database problem 1661: Average Time of Process per Machine. I'm using MySQL but this solution should work in any SQL dialect such as PostgreSQL SQL Server, etc.
Link to the problem: https://leetcode.com/problems/average-time-of-process-per-machine/
Playlists:
LeetCode database SQL problems: https://youtube.com/playlist?list=PLdrw9_aIADIPAMJW8I_S-S747oyiRtzpS
Easy SQL problems: https://youtube.com/playlist?list=PLdrw9_aIADINpdkxu_RHaY16QmG8-mRSm
Medium SQL problems: https://youtube.com/playlist?list=PLdrw9_aIADIMSQe_-m6xknIdPPNiYngKh
Hard SQL problems: https://youtube.com/playlist?list=PLdrw9_aIADIP0sYoOt2mql4Hb06Y1D0z2