Question: What % of respondents want to use which programming languages?
SQL:
SELECT Languages.name, COUNT(Languages.id) * 100.0 / (SELECT COUNT(DISTINCT Response_id) FROM Response_LanguageWantToWorkWith) FROM Languages JOIN Response_LanguageWantToWorkWith ON Response_LanguageWantToWorkWith.Languages_id = Languages.id GROUP BY Languages.id
SELECT Languages.Name, COUNT(*) * 100.0 / (SELECT COUNT(*) FROM Responses) AS Percentage FROM Response_LanguageWantToWorkWith JOIN Languages ON Response_LanguageWantToWorkWith.Languages_id = Languages.id GROUP BY Languages.Name