GlobalLogic Interview Question

Basic Programming SQL a puzzle question