ZS Associates Interview Question

How Group by works in SQL