[SQL] “Finding user purchases” – Amazon

Find the solution and explanation for an Amazon SQL Interview question.