SELECT and FROM elements are mandatory fields in SQL query, it means:
WHERE clause was not requested,you can filter broadly via applying other columns, not only columns mentioned in GROUP BY query.Note that that is difference between WHERE and HAVING elements.
HAVING can be used only with the SELECT statement. HAVING is typically used in a GROUP BY clause. When GROUP BY is not used, HAVING behaves like a WHERE clause.
To sum up, handling the required whole data from source is primary, then by filtering process getting reduced amount of data to work efficiently on, summarize data as group or cluster, filter according to collected information again, and arranging them by specific column names as ascending or descending order.
Order of SELECT statement clauses in SQL:
FROM WHERE GROUP BY HAVING SELECT ORDER BY
To get broad explanations check my YouTube video out (in Turkish only).