sql medium level questions leetcode