Cognizant interview question

How does GROUP BY work?