title: Why do we need GROUP BY with AGGREGATE FUNCTIONS?
body: <p>I saw an example where there was a list (table) of employees with their respective monthly salaries. I did a sum of the salaries and saw the exact same table in the ouptput. That was strange.</p>
  <p>Here is what has to be done - we have to find out how much money we pay this month as employee salaries. For that, we need to sum their salary amounts in the database as shown:</p>
  <pre><code>SELECT EmployeeID, SUM (MonthlySalary) 
  FROM Employee
  GROUP BY EmpID
  </code></pre>
  <p>I know that I get an error if I don't use <code>GROUP BY</code> in the above code. This is what I don't understand.</p>
  <p>We are selecting EmployeeID from the Employee table. <code>SUM()</code> is being told that it has to add the MonthlySalary column, from the Employee table. So, it should directly go and add those numbers up instead of grouping them and then adding them.</p>
  <p>Thats how a person would do it - look at the employee table and add all the numbers. Why would they take the trouble to group them and then add them up?</p>