Whenever you're ready, walk me through how you'd approach this.
How would you write a SQL query using aggregations and group by?
Explain how aggregate functions summarize rows within groups, how GROUP BY defines those groups, and how filters differ before and after aggregation. Include a concise PostgreSQL example and mention relevant edge cases such as NULL values.