Question: What is the % of Automated testing setup per industry?
SQL:
WITH rel_prof_ind AS (SELECT r.*, p.*, s.Industry FROM Response_ProfessionalTech AS r JOIN ProfessionalTech AS p ON r.ProfessionalTech_id = p.id JOIN Responses AS s ON r.Response_id = s.id WHERE NOT s.Industry IS NULL) SELECT Industry, COUNT(DISTINCT CASE WHEN name = 'Automated testing' THEN Response_id END) * 100.0 / COUNT(DISTINCT Response_id) AS ratio FROM rel_prof_ind GROUP BY Industry ORDER BY ratio DESC