Equifax interview question

Answer this leetcode sql problem