Publicis Sapient interview question

A group by based SQL query