Yahoo interview question

Medium leetcode- array, SQL- having clause and joins