新浪2019.8.31数据分析笔试题目

1.
2.
3.



#新浪##笔试题目##数据分析师#
全部评论
欢迎各位大佬指正 1. select a.type, sum(a.vnum)/count(a.uid) as avg, round( sum(case when a.date='20180711'then a.vnum else 0 end)/count(distinct case when a.date='20180711'then a.uid else null end) -sum(case when a.date='20180710' then a.vnum else 0 end)/count(distinct case when a.date='20180710'then a.uid else null end), 4)as increase from( select v.date as date, v.uid as uid, v.vid as vid, info.channel_type as type, count(vid) as vnum from  user_video as v left join new_user_info as info on v.uid=info.uid  where v.date in ('20180710','20180711')group by date,uid,type )a  group by a.type; 2.  select uid from(     select a.date,a.uid,     sum(if(date>='20190801'and date<='20190807',1,0))as num1,     sum(if(date='20190808',1,0))as num2 from( select v.date,v.uid from user_video v join user_info i on v.uid=i.uid where v.tag='美食' and i.age<=25 and i.gender='女'     )a group by a.uid )b where b.num1>10 and b.num2<3; 3. select a.tag,max(a.num)-min(a.num)from(     select tag,uid,count(distinct vid) as num from user_video group by tag,uid ) a group by a.tag;
点赞
送花
回复 分享
发布于 2019-08-31 21:24

相关推荐

2 57 评论
分享
牛客网
牛客企业服务