Swiss Re interview question

How to join and group in sql