leetcode/solution/1900-1999/1934.Confirmation Rate/Solution.sql

9 lines
217 B
SQL

# Write your MySQL query statement below
SELECT
user_id,
ROUND(IFNULL(SUM(action = 'confirmed') / COUNT(1), 0), 2) AS confirmation_rate
FROM
SignUps
LEFT JOIN Confirmations USING (user_id)
GROUP BY 1;