Https://www.codecademy.com/paths/data-science/tracks/analyze-data-sql-analyze-real-data/modules/analyze-data-sql-usage-funnels/projects/analyze-data-sql-usage-funnels-with-warby-parker

Query not working for Usage Funnels project.sqlite:

https://www.codecademy.com/paths/data-science/tracks/analyze-data-sql-analyze-real-data/modules/analyze-data-sql-usage-funnels/projects/analyze-data-sql-usage-funnels-with-warby-parker

I cannot understand why this query is not working that I am using in order not to use Excel spreadsheet:

SELECT COUNT (CASE
WHEN question =‘1. What are you looking for?’ THEN user_id END) AS ‘Q.1’,
COUNT (CASE
WHEN question =‘2. What’‘s your fit?’ THEN user_id END) AS ‘Q.2’,
COUNT (CASE WHEN question = '3. Which shapes do you like?'THEN user_id END) AS ‘Q.3’,
COUNT(CASE WHEN question = ‘4. Which colors do you like?’ THEN user_id END) AS ‘Q.4’,
COUNT (CASE WHEN question = ‘5. When was your last eye exam?’ THEN user_id END) AS ‘Q.5’
FROM survey;

It just returns me the correct number for Question 2 and Question 5. As for the remaining questions, their COUNT value is 0.
Could you help me please?

I have a feeling you have a typo or something but to reduce the risk of that use LIKE instead of =

Try this:

WITH q as(
SELECT
COUNT(CASE WHEN question LIKE ‘1%’ THEN user_id END) AS ‘Q1’,
COUNT(CASE WHEN question LIKE ‘2%’ THEN user_id END) AS ‘Q2’,
COUNT(CASE WHEN question LIKE ‘3%’ THEN user_id END) AS ‘Q3’,
COUNT(CASE WHEN question LIKE ‘4%’ THEN user_id END) AS ‘Q4’,
COUNT(CASE WHEN question LIKE ‘5%’ THEN user_id END) AS ‘Q5’
FROM survey)
SELECT 100.0 * Q2/Q1 as ‘1-to-2’,
100.0 * Q3/Q2 as ‘2-to-3’,
100.0 * Q4/Q3 as ‘3-to-4’,
100.0 * Q5/Q4 as ‘4-to-5’
FROM q;

ALSO, I want to know if SQL without Excel is a viable thing? or is that why ppl use python as well as? any link to a more rich discussion is welcome! <3