Dimentrix interview question

SQL and Database related , puzzles