티스토리 뷰
https://leetcode.com/problems/confirmation-rate
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
with base as (
select
user_id
, count(distinct if(action = 'confirmed', time_stamp, null))/count(distinct time_stamp) confirmation_rate
from Confirmations
group by 1
)
select
distinct c.user_id
, if(b.confirmation_rate is null, 0, round(b.confirmation_rate,2)) confirmation_rate
from Signups c
left join base b on c.user_id = b.user_id
'프로그래밍연습 > SQL' 카테고리의 다른 글
[SQL]weather-observation-station-5 (0) | 2023.08.25 |
---|---|
[SQL]rising-temperature (0) | 2023.08.24 |
[SQL]exchange-seats (0) | 2023.08.21 |
[SQL]friend-requests-ii-who-has-the-most-friends (0) | 2023.08.20 |
[SQL]game-play-analysis-iv (0) | 2023.08.19 |
공지사항
최근에 올라온 글
최근에 달린 댓글
- Total
- Today
- Yesterday
링크
TAG
- 중앙값
- 파이썬
- 뇌하수체
- SQL
- hash
- TensorFlow
- 통계
- leatcode
- 확률
- programmers
- 프로그래머스
- 뇌하수체선종
- 힙
- 상대도수
- counter
- 코딩테스트
- 사분위수
- 분산
- 군고구마
- neural network
- 확률분포
- Lambda
- 상관관계
- Python
- random forest
- 평균
- 쿠싱증후군
- 분당서울대병원
- 쿠싱
- 조건부확률
일 | 월 | 화 | 수 | 목 | 금 | 토 |
---|---|---|---|---|---|---|
1 | 2 | 3 | 4 | 5 | ||
6 | 7 | 8 | 9 | 10 | 11 | 12 |
13 | 14 | 15 | 16 | 17 | 18 | 19 |
20 | 21 | 22 | 23 | 24 | 25 | 26 |
27 | 28 | 29 | 30 |
글 보관함