Skip to content

Instantly share code, notes, and snippets.

@codecademydev
Created Jul 16, 2020
Embed
What would you like to do?
Codecademy export
SELECT *
FROM survey
LIMIT 10;
SELECT question,
COUNT(DISTINCT user_id)
FROM survey
GROUP BY question;
SELECT question,
COUNT(DISTINCT user_id)
FROM survey
GROUP BY 1;
SELECT *
FROM quiz
LIMIT 5;
SELECT *
FROM home_try_on
LIMIT 5;
SELECT *
FROM purchase
LIMIT 5;
SELECT DISTINCT q.user_id,
h.user_id IS NOT NULL AS 'is_home_try_on',
h.number_of_pairs,
p.user_id IS NOT NULL AS 'is_purchase'
FROM quiz q
LEFT JOIN home_try_on h
ON q.user_id = h.user_id
LEFT JOIN purchase p
ON p.user_id = q.user_id
LIMIT 10;
@elmulix
Copy link

elmulix commented Aug 17, 2020

Thanks for sharing!
I´ve got the same code as you.
Keep on sharing.

Best regards!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment