Pregunta de entrevista de Payrails

SQL question to join databases and provide a specific output