title: Difference between old and new SQL JOINS
body: <p>I am currently learing SQL and I can't understand why these two queries return different numbers of rows (the first one returns 53, while the second returns 69).</p>
  
  <pre><code>SELECT d.department_name "dept_name",
     j.job_title "job_title",
     e.manager_id "manager_id",
     MAX(e.salary) "max_salary",
     SUM(e.salary) "sum_salary"
  FROM employees e, jobs j, departments d
  WHERE j.job_id = e.job_id AND
        d.department_id(+) = e.department_id
  GROUP BY GROUPING SETS( (d.department_name, j.job_title), (j.job_title,e.manager_id), ());
  </code></pre>
  
  <p>And the second one:</p>
  
  <pre><code>SELECT d.department_name AS "dept_name",
  j.job_title AS "job_title",
    e.manager_id AS "manager_id",
      MAX(e.salary) AS "max_salary",
        SUM(e.salary) AS "sum_salary"
  FROM employees e
  INNER JOIN jobs j ON j.job_id = e.job_id
  RIGHT OUTER JOIN departments d ON d.department_id = e.department_id
  GROUP BY GROUPING SETS( (d.department_name, j.job_title), (j.job_title,e.manager_id),  ());
  </code></pre>
  
  <p>Thank you for your help!</p>