Question: How many users want to work with a specific technical tool in %?
SQL:
SELECT TechTools.name, COUNT(TechTools.id) * 100.0 / (SELECT COUNT(DISTINCT Response_id) FROM Response_ToolsTechWantToWorkWith) FROM TechTools JOIN Response_ToolsTechWantToWorkWith ON Response_ToolsTechWantToWorkWith.TechTools_id = TechTools.id GROUP BY TechTools.id
SELECT TechTools.Name, COUNT(*) * 100.0 / (SELECT COUNT(*) FROM Responses) AS Percentage FROM Response_ToolsTechWantToWorkWith JOIN TechTools ON Response_ToolsTechWantToWorkWith.TechTools_id = TechTools.id GROUP BY TechTools.Name