Publicis Sapient Interview Question

A group by based SQL query