Problems / Join with Aggregation / Editorial
employees
departments
dept_id
dept_name
total_salary
The join happens before the aggregation. First you combine the data, then you summarize it. This is a very common pattern in analytics queries.
Solve Join with Aggregation yourself →