题解 | SaaS产品高价值用户活跃度分析

SaaS产品高价值用户活跃度分析

https://www.nowcoder.com/practice/439f6de3254143e7b3673ed0259d98b0

with t1 as
(select distinct ue.user_id
from user_events ue 
join users u using(user_id)
where (registration_date >= '2025-01-01' and registration_date<'2025-07-01') 
and plan_type ='Pro' 
and (event_timestamp >= '2025-01-01' and event_timestamp<'2025-04-01')
and event_type='login'),
t2 as
(select t1.user_id,sum(case when event_type='create_task' then 5 when event_type='export_report' then 10 when event_type='invite_member' then 8 else 1 end) total_activity_score
from t1
join user_events ue using(user_id)
group by 1),
t3 as
(select t1.user_id,round(count(*)/3,2) avg_monthly_events
from t1
join user_events ue using(user_id)
where event_timestamp >='2025-01-01' and event_timestamp<'2025-04-01'
group by 1)
select concat(user_name,'(',t2.user_id ,')') user_profile,total_activity_score,avg_monthly_events
from t2
join t3 using(user_id)
join users u using(user_id)
order by total_activity_score desc,avg_monthly_events desc,t2.user_id

全部评论

相关推荐

03-03 23:12
已编辑
北京邮电大学 Java
书海为家:我来给一点点小建议,因为毕竟还在学校不像工作几年的老鸟有丰富的项目经验,面试官在面试在校生的时候更关注咱们同学的做事逻辑和思路,所以最好在简历中描述下自己做过项目的完整过程,比如需求怎么来的,你对需求的解读,你想到的解决办法,遇到困难如何找人求助,最终项目做成了什么程度,你从中收获了哪些技能,你有什么感悟。
你的简历改到第几版了
点赞 评论 收藏
分享
评论
点赞
收藏
分享

创作者周榜

更多
牛客网
牛客网在线编程
牛客网题解
牛客企业服务