ZS Associates Interview Question

Few puzzles and some questions around SQL