其他
数据分析师笔试题 | 真题实战②
The following article is from 求知鸟 Author 求知鸟
历史面试笔试题(点击可查看):
select percentile_approx(event_num_map,array(0.2,0.5,0.8),9999)
from event_summary
where Partition_date = ${date}
and event_name=profile.index
select t2.行为频次, count(distinct t2.user_id),count(distinct t2.user_id)/count(distinct t1.user_id),sum(count(distinct t2.user_id)) over(partition by t2.行为频次 )
from (
select user_id from event_summary
where Partition_date between $(begin_date) and ${end_date}
)t1
left join(
select user_id,case when event_num_map between 0 and 5 then '0~5'
when event_num_map between 6 and 10 then '6~10'
else '其它'
end as '行为频次'
from event_summary
where Partition_date between $(begin_date) and ${end_date}
)t2
on t1.user_id=t2.user_id
group by t2.行为频次
select Partition_date,case when datediff(t2.Partition_date,t1.Partition_date)=1 then count(distinct t1.user_id) end) as '流失1天',
case when datediff(t2.Partition_date,t1.Partition_date)=2 then count(distinct t1.user_id) end) as '流失2天',
case when datediff(t2.Partition_date,t1.Partition_date)=3 then count(distinct t1.user_id) end) as '流失3天',
case when datediff(t2.Partition_date,t1.Partition_date)>=30 then count(distinct t1.user_id) end) as '流失30天以上',
from (
select user_id,Partition_date
from usre_active
where daily_active_status_map=1
)t1
left join (
select user_id,Partition_date
from usre_active
where daily_active_status_map=1
)t2
on t1.user_id=t2.user_id
where t2.user_id is null
group by Partition_date
order by Partition_date desc
后台回复「进群」,加入读者交流群~
点击「积分」,了解积分规则~