Pregunta de entrevista de Swiss Re

How to join and group in sql