https://school.programmers.co.kr/learn/courses/30/lessons/131534
두 테이블을 합쳐주고,
SELECT YEAR(sales_date) YEAR , MONTH(sales_date) MONTH,
count(DISTINCT A.user_id) PUCHASED_USERS,
ROUND(COUNT(DISTINCT A.USER_ID) / (SELECT COUNT(DISTINCT USER_ID) FROM USER_INFO WHERE YEAR(JOINED) = '2021'), 1) AS PUCHASED_RATIO
FROM user_info A RIGHT join online_sale B ON A.user_id = B.user_id
WHERE YEAR(joined) = '2021'
GROUP BY YEAR,MONTH
ORDER BY YEAR,MONTH