Starbucks Interview Question

It was a Leetcode medium SQL question.