카테고리 없음

내일배움캠프 데이터분석가 10기_13회차

note25140 2025. 11. 5. 20:07

▶학습내용 

 

문제1)

select game_account_id,actor_cnt,avg_amount

from

(

select u.game_account_id,count(distinct u.game_actor_id)as actor_cnt,avg(p.total_amt)as avg_amount

from

(

select*

from basic.users

where serverno>=2

)as u

inner join

(

select game_account_id,sum(pay_amount)as total_amt

from basic.payment as p

where pay_type='CARD'

group by game_account_id

)as p

on u.game_account_id=p.game_account_id

group by u.game_account_id

) as k

where actor_cnt>=2

order by avg_amount desc

 

-> 조인 응용문제