Pregunta de entrevista de Siemens

Asked to write an SQL query.