https://leetcode.com/problems/confirmation-rate/description/
Confirmation Rate - LeetCode
Can you solve this real interview question? Confirmation Rate - Table: Signups +----------------+----------+ | Column Name | Type | +----------------+----------+ | user_id | int | | time_stamp | datetime | +----------------+----------+ user_id is the prima
leetcode.com
1
2
3
4
5
6
|
# Write your MySQL query statement below
select s.user_id, round(sum(case when c.action='confirmed' then 1 else 0 end)/count(s.user_id) , 2) confirmation_rate
from Confirmations c
right join Signups s
on c.user_id = s.user_id
group by s.user_id
|
cs |
반응형
'SQL' 카테고리의 다른 글
leetcode https://leetcode.com/problems/last-person-to-fit-in-the-bus/ (0) | 2023.04.21 |
---|---|
leetcode 1075. Project Employees I (0) | 2023.04.21 |
leetcode 1661. Average Time of Process per Machine (0) | 2023.04.14 |
leetcode 1068. Product Sales Analysis I (0) | 2023.04.14 |
leetcode 1280. Students and Examinations (0) | 2023.04.12 |
댓글