Domanda di colloquio di IBM

Basic SQL question. And one data structure question.