Question: How much do people who responded to this survey want to use a synchronous communication tools in % and which tools are they?
SQL:
SELECT OfficeStackSync.name, COUNT(OfficeStackSync.id) * 100.0 / (SELECT COUNT(DISTINCT Response_id) FROM Response_OfficeStackSyncWantToWorkWith) FROM OfficeStackSync JOIN Response_OfficeStackSyncWantToWorkWith ON Response_OfficeStackSyncWantToWorkWith.OfficeStackSync_id = OfficeStackSync.id GROUP BY OfficeStackSync.id
SELECT OfficeStackSync.Name, COUNT(*) * 100.0 / (SELECT COUNT(*) FROM Responses) AS Percentage FROM Response_OfficeStackSyncWantToWorkWith JOIN OfficeStackSync ON Response_OfficeStackSyncWantToWorkWith.OfficeStackSync_id = OfficeStackSync.id JOIN Responses ON Response_OfficeStackSyncWantToWorkWith.Response_id = Responses.id WHERE NOT Responses.SurveyAgreement IS NULL GROUP BY OfficeStackSync.Name