Question: How many respondents learning to code want to use which AI search tool and what search tool are they using?
SQL:
SELECT AISearch.name AS have_worked_with, AISearch.name AS want_to_work_with, COUNT(*) FROM Response_AISearchHaveWorkedWith JOIN AISearch ON Response_AISearchHaveWorkedWith.AISearch_id = AISearch.id JOIN Response_AISearchWantToWorkWith ON Response_AISearchWantToWorkWith.Response_id = Response_AISearchHaveWorkedWith.Response_id JOIN Responses ON Response_AISearchWantToWorkWith.Response_id = Responses.id WHERE Responses.ResponderDescription = 'I am learning to code' GROUP BY AISearch.name, AISearch.name
SELECT AISearch.Name AS "AI Search Tool", COUNT(*) AS "Number of Respondents" FROM Response_AISearchWantToWorkWith JOIN AISearch ON Response_AISearchWantToWorkWith.AISearch_id = AISearch.id JOIN Response_LearningToCodeMethods ON Response_AISearchWantToWorkWith.Response_id = Response_LearningToCodeMethods.Response_id GROUP BY AISearch.Name UNION SELECT AISearch.Name AS "AI Search Tool", COUNT(*) AS "Number of Respondents" FROM Response_AISearchHaveWorkedWith JOIN AISearch ON Response_AISearchHaveWorkedWith.AISearch_id = AISearch.id JOIN Response_LearningToCodeMethods ON Response_AISearchHaveWorkedWith.Response_id = Response_LearningToCodeMethods.Response_id GROUP BY AISearch.Name