select a.DivisionName, a.CourseName, a.ParticipantsCount, ParticipantCount/EmployeeCount * 100 as PercentCompleted
from (
select DivisionName, count(*) as EmployeeCount
from Division d
inner join Employee e on d.DivisionCode = e.DivisionCode
group by DivisionName
) dc
inner join (
select d.DivisionName, c.CourseName, count(*) as ParticipantCount
from Course c
inner join Employee_Course ec on c.CourseID = ec.CourseID
inner join Employee e on ec.Username = e.Username
inner join Division d on e.DivisionCode = d.DivisionCode
group by DivisionName, CourseName
) a on dc.DivisionName = a.DivisionName
コースの完了を示すものは何ですか? – RedFilter
完了率は、コースを受講した参加者または従業員の総数/その部門の従業員の総数を意味します。 Employee_Course Table:取られたまたは完了したコースのIDを持つ従業員のユーザー名を表示します –