Pregunta de entrevista de Tatvasoft

One easy coding question followed by SQL query