Pregunta de entrevista de Tata Consultancy Services

Question on DB, and programming