1010data Interview Question

How group by works?