IBM interview question

Questions were LeetCode Medium, SQL