QCC 4회차

손민섭·2025년 4월 11일

QCC 리뷰

목록 보기
4/5
post-thumbnail

1번 문제



손민섭의 킥

with ranked_stores as (
    select region_name, sales,
           row_number() over (partition by region_name order by sales desc) as rn,
           count(*) over (partition by region_name) as cnt
    from stores
)
select region_name, sales as highest_sales
from ranked_stores
where rn = 1 and cnt >= 2;

2번 문제


3번 문제




손민섭의 킥

왜 count(distinct fb.user_id)가 아니고 count(distinct o.user_id) 일까

라이브 해설 강의 4회차 41분08초 튜터님의 설명

left join 을 한뒤 where ~ is null로 처리했기 때문에 왼쪽과 오른쪽의 카운트 수가 다르게 나오고 left join이기 때문에 왼쪽을 기준으로 카운트 한다 inner join은 똑같음

그리고 버그걸린 상황을 카운트하는게 아니라 그 버그 유저를 뽑아내는거기 때문에 distinct 0.user_id로 하는게 맞다

profile
데이터분석가(진)

0개의 댓글