Skip to content

Instantly share code, notes, and snippets.

@codecademydev

codecademydev/project.sqlite Secret

Created Feb 19, 2020
Embed
What would you like to do?
Codecademy export
--Difference of purchase rates between customers who had 3 number_of_pairs with ones who had 5
WITH comb3 AS (SELECT quiz.user_id, CASE WHEN number_of_pairs IS NOT NULL THEN 'True'
ELSE 'False'
END AS 'is_home_try_on', number_of_pairs, CASE WHEN price IS NOT NULL THEN 'True'
ELSE 'False'
END AS 'is_purchase'
FROM quiz
LEFT JOIN home_try_on
ON quiz.user_id = home_try_on.user_id
LEFT JOIN purchase
ON home_try_on.user_id = purchase.user_id)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment