Question: What percentage of respondents use which approach to research new tools and technologies?
SQL:
SELECT BuyNewTool.name, COUNT(BuyNewTool.id) * 100.0 / (SELECT COUNT(DISTINCT Response_id) FROM Response_BuyNewTool) FROM Response_BuyNewTool JOIN BuyNewTool ON BuyNewTool.id = Response_BuyNewTool.BuyNewTool_id GROUP BY BuyNewTool.id
SELECT BuyNewTool.Name, COUNT(*) * 100.0 / (SELECT COUNT(*) FROM Response_BuyNewTool) AS Percentage FROM Response_BuyNewTool JOIN BuyNewTool ON Response_BuyNewTool.BuyNewTool_id = BuyNewTool.id GROUP BY BuyNewTool_id