I have the following database design:
And I need to develop one query that will display a table that shows the total number of employees in all departments and the total number of participants who completed the survey in all departments. I could be able to find the total number of employees in all department by the following query:
Then, I could be able to find the total number of participants in all department by the following query:
But I should have a one query only. For example, if Department A has 100 employee and the number of participants is 50 out of 100 and Department B has 80 employee and the number of participants is 30 The query should show the following: the total number of employees in all departments = 180 the total number of participants in all departments = 80 the percent completion in all of them = 80/180 = 44% So how to do that?
(comments are locked)

This should do it:
I have found that you need to keep the cast to decimal in otherwise it returns 0.
(comments are locked)
