Question: What % of people want to keep using which AI search tool?
SQL:
SELECT AISearch.name, COUNT(AISearch.id) * 100.0 / count2 FROM AISearch JOIN Response_AISearchHaveWorkedWith ON Response_AISearchHaveWorkedWith.AISearch_id = AISearch.id JOIN Response_AISearchWantToWorkWith ON Response_AISearchWantToWorkWith.Response_id = Response_AISearchHaveWorkedWith.Response_id AND Response_AISearchWantToWorkWith.AISearch_id = AISearch.id JOIN (SELECT AISearch.name AS name2, COUNT(AISearch.id) AS count2 FROM AISearch JOIN Response_AISearchHaveWorkedWith ON Response_AISearchHaveWorkedWith.AISearch_id = AISearch.id GROUP BY AISearch.id) ON AISearch.name = name2 GROUP BY AISearch.id