The SQL GROUP BY clause is used to retrieve data grouped by one or more columns. It is often used with aggregate functions like SUM to calculate totals for each group. For example, to find the total salary for each department, the query would select the department and sum of salaries, grouping by department. This groups the results by department and calculates the total salary for each department group.