title: How to modify this query to show the total number of employees and percent completion in each division?
body: <p>I have the following database design:</p>
  
  <pre><code>Employee Table: Username, Name, DivisionCode
  Division Table: SapCode, DivisionShortcut
  Courses Table: CourseID, CourseName, GroupID
  Groups Table: GroupID, GroupName
  Employee_Courses Table: EmployeeID, CourseID
  </code></pre>
  
  <p>I came up with the following query that shows the divisions, courses and the total number of participants in each division:</p>
  
  <pre><code>SELECT     dbo.Divisions.DivisionShortcut, dbo.courses.CourseName, COUNT(dbo.employee_courses.courseId) AS [Total Number of Participants]
  FROM         dbo.courses INNER JOIN
                        dbo.employee_courses ON dbo.courses.CourseID = dbo.employee_courses.courseId INNER JOIN
                        dbo.groups ON dbo.courses.GroupID = dbo.groups.ID RIGHT OUTER JOIN
                        dbo.employee AS employee_1 INNER JOIN
                        dbo.Divisions ON employee_1.DivisionCode = dbo.Divisions.SapCode ON dbo.employee_courses.employeeId = employee_1.Username
  WHERE     (dbo.courses.GroupID = 1)
  GROUP BY dbo.courses.CourseID, dbo.courses.CourseName, dbo.Divisions.DivisionShortcut
  </code></pre>
  
  <p>In addition to be shown above, I want to display the total number of employees in each division and the percent completion in each division, too. By the way, the percent completion is equal to <strong><em>(total number of participants in each course / total number of employees in each division)</em></strong></p>
  
  <p><strong>So how to do that?</strong> </p>