A single total is not enough when the question says "per department" or "per city". GROUP BY splits rows into groups and runs the aggregate once for each group. Use it whenever you see "for each" or "per" in a question. Every column you select must either be grouped or be inside an aggregate, which is the most common mistake beginners make.