Leetcode Insert Into Sql With Multiple Joins On Same Table