IBM interview question

SQL question and an easy coding question.