Question: What percentages of respondents used which online learning platforms to learn coding?
SQL:
SELECT LearningToCodePlatforms.name, COUNT(LearningToCodePlatforms.id) * 100.0 / (SELECT COUNT(DISTINCT Response_id) FROM Response_LearningToCodePlatforms) FROM LearningToCodePlatforms JOIN Response_LearningToCodePlatforms ON LearningToCodePlatforms.id = Response_LearningToCodePlatforms.LearningToCodePlatforms_id GROUP BY LearningToCodePlatforms.id
SELECT LearningToCodePlatforms.Name, COUNT(*) * 100.0 / (SELECT COUNT(*) FROM Responses) AS Percentage FROM Response_LearningToCodePlatforms JOIN LearningToCodePlatforms ON Response_LearningToCodePlatforms.LearningToCodePlatforms_id = LearningToCodePlatforms.id GROUP BY LearningToCodePlatforms.Name