r/SQL • u/Plus_Kiwi_2592 • Oct 20 '26
MySQL COUNT() vs COUNT() OVER()
I've found this query as a solution to the famous Pizza Runner case study, and I am stuck at figuring out what COUNT() returns, compared to COUNT() OVER().
I know OVER() does the count (or whatever aggregation) over the entire dataset, but idk I'm just not getting the percentage part of this query.
Help :)
29
Upvotes
View all comments
Show parent comment
2
u/Plus_Kiwi_2592 Oct 21 '26
The phrasing bothered me too. But if you see the schema then you'll just know volume isn't the size.
I rarely hear the word volume being used in certain corporate spaces, but there are a few that make use of it that way.
Just goes to show that the most important part of analytics is the business sense, not the syntax. If the business question is wrong, then the syntax will give wrong insight.