Other niche but useful features I've found with GROUP BY:
1. You can filter the rows used for the aggregate using a FILTER clause [1]: `group_concat(name order by name desc) filter where(salary > 100)`. While you could do the same filter in the main query, this form would still give you departments where all employees are filtered out.
2. When selecting non-aggregate values in a GROUP BY, an arbitrary row is typically picked. You can control which one is picked by using min() or max() on a different column [2]. Example: `select depertment, name as best_earner, max(salary) as best_salary from employees group by department`
[1]: https://www.sqlite.org/lang_aggfunc.html
[2]: https://www.sqlite.org/lang_select.html#bare_columns_in_an_a...