By the end of this page you can write a summary query and know its answer is real. You will know exactly what GROUP BY does to your rows, which columns you are allowed to select afterwards and why, where WHERE goes, where HAVING goes, and why swapping them is the difference between a finding and...
Source: [Dev.to](https://dev.to/michaelnocito/group-by-and-having-how-to-summarize-rows-without-getting-a-fake-answer-1jkb)