How to show the overall of participation of each division in all offered quizzes?
I am a new web developer and I am developing a simple training management system which provides the users with quizzes. The system developed using
ASP.NET and SQLServer. I have the following database design: Employee Table: Username, Name, DivisionCode Divisions Table: SapCode, Divison Quiz Table: QuizID, Title, Description, IsSent UserQuiz: UserQuizID, QuizID, DateTimeComplete, Username
(DivisionCode is a foreign key to the SapCode. IsSent is a flag to indicate to the quizzes that have been offered and sent to the users to participate in them.) I need to come up with a query that shows the percentage of participation of each division in all the offered safety quizzes (which means quizzes with IsSent = true). For example, If I have four divisions; A, B, C and D, and I have around 23 quizzes have been sent to the employees in those divisions. Since each division has a specific percentage of participation in each quiz. My query should show the overall percentage of participation in all offered quizzes for each division. So the result should not be broken down with respect to each quiz.
So how to do that?