Pregunta de entrevista de Finoit

Some puzzles from internet and SQL queries.