首页
题库
公司真题
专项练习
面试题库
在线编程
面试
面试经验
AI 模拟面试
简历
求职
学习
基础学习课
实战项目课
求职辅导课
专栏&文章
竞赛
我要招人
发布职位
发布职位、邀约牛人
更多企业解决方案
AI面试、笔试、校招、雇品
HR免费试用AI面试
最新面试提效必备
登录
/
注册
芋头炒冰
获赞
19
粉丝
8
关注
3
看过 TA
120
女
University of Liverpool
2024
运营
IP属地:北京
长期小米内推/运营职场碎碎念/英国留学/互联网4A
私信
关注
拉黑
举报
举报
确定要拉黑芋头炒冰吗?
发布(47)
评论
刷题
收藏
芋头炒冰
关注TA,不错过内容更新
关注
2024-03-13 22:16
University of Liverpool 运营
【小米】本部门招产品实习生,欢迎投递呀
直接扫码投递,想要了解岗位可以私信我哈
投递小米集团等公司8个岗位
0
点赞
评论
收藏
分享
2023-02-22 00:37
University of Liverpool 运营
2023-02-22
在牛客打卡3天,今天也很努力鸭!
0
点赞
评论
收藏
分享
2023-01-09 00:57
University of Liverpool 运营
题解 | #截取出年龄# 截取两遍是关键
正确题解: select substring_index(substring_index(profile,',',3),',',-1) as age, #重点 count(device_id) as number from user_submit group by age ⚠️Stella的两个迷糊点:因为age在中间所以要截取两遍,才可以截取到直接使用substring_index()时提取,不需要自己用case再分类
0
点赞
评论
收藏
分享
2023-01-09 00:45
University of Liverpool 运营
题解 | #统计每种性别的人数# substring_
正确题解1: select case when substring_index(profile,',',-1) ='male' then 'male' when substring_index(profile,',',-1) ='female' then 'female' end as gender, count(device_id) as number from user_submit group by gender 🌟substring_index()函数的关键用法:如果count是正数,那么就是从左往右数,第N个分隔符的左边的所有内容如果count是负数,那么就是从右往左数,第N...
0
点赞
评论
收藏
分享
2023-01-09 00:05
University of Liverpool 运营
题解 | #计算25岁以上和以下的用户数量# case语句
正确题解: select case when age<25 or age is null then '25岁以下' when age>=25 then '25岁及以上' end as age_cut, count(device_id) as number from user_profile group by age_cut #忘记group by 注意case then的格式
0
点赞
评论
收藏
分享
2023-01-08 17:55
University of Liverpool 运营
今天来刷sql题!
2023-01-08
在牛客打卡2天,今天学习:刷题 27 道/代码提交 71 次
0
点赞
评论
收藏
分享
2023-01-08 17:54
已编辑
University of Liverpool 运营
题解 | #21年8月份练题总数# 三种限定时间条件的方法
正确题解: select count(distinct device_id) as did_cnt, count(question_id) as question_cnt from question_practice_detail where year(date)=2021 and month(date)=8 刚学完year和month函数,所以这道题一次就通过了,但还有两种限定时间条件的方法,需要掌握!个人感觉year、month函数和like语法比较好理解,date_format函数格式有些复杂限定条件:2021年8月份,匹配date字段即可,匹配方法主要有三种:(1)like语法:dat...
0
点赞
评论
收藏
分享
2023-01-08 17:35
University of Liverpool 运营
题解 | #计算用户8月每天的练题数量# 关于时间的函数
正确题解: select day(date) as day, #day() count(question_id) as question_cnt from question_practice_detail where year(date)=2021 and month(date)=8 #year(),month() group by date 限定条件:2021年8月,写法有很多种,比如用year/month函数的year(date)=2021 and month(date)=8,比如用date_format函数的date_format(date, "%Y-%m")="202108"学会了一个...
0
点赞
评论
收藏
分享
2023-01-08 17:14
University of Liverpool 运营
题解 | #查找山东大学或者性别为男生的信息# union
正确题解: select device_id, gender, age, gpa from user_profile where university = '山东大学' union all #本题重点 select device_id, gender, age, gpa from user_profile where gender = 'male' 学到了一个新东西:union all分别查看&结果不去重:所以直接使用两个条件的or是不行的,直接用union也不行,要用union all,分别去查满足条件1的和满足条件2的,然后合在一起不去重结果不去重就用union all,去重就...
0
点赞
评论
收藏
分享
2023-01-08 17:02
University of Liverpool 运营
题解 | #统计每个用户的平均刷题数# 第一次一次做对中等题
正确解法: select university, difficult_level, count(a.question_id) / count(distinct a.device_id) as avg_answer_cnt from question_practice_detail as a left join user_profile as b on a.device_id=b.device_id left join question_detail as c on a.question_id=c.question_id where university = '山东大学' group by d...
0
点赞
评论
收藏
分享
2023-01-08 16:54
University of Liverpool 运营
题解 | #统计每个学校各难度的用户平均刷题数# 中等
正确解法: select university, difficult_level, round(count(a.question_id) / count(distinct a.device_id), 4) as avg_answer_cnt from question_practice_detail as a #注意哪个表放在left join左边 left join user_profile as b on a.device_id = b.device_id left join question_detail as c on a.question_id = c.que...
0
点赞
评论
收藏
分享
2023-01-08 16:01
University of Liverpool 运营
题解 | #统计每个学校的答过题的用户的平均答题数# 注意
解法: select university, count(b.question_id)/count(distinct b.device_id) as avg_answer_cnt from user_profile as a join question_practice_detail as b on a.device_id = b.device_id #注意 group by university #每个学校:所以按学校分组,group by university order by university ⚠️ 注意事项:联结两个表:join on在ab表共有且唯一识别的device_id计算平...
0
点赞
评论
收藏
分享
2023-01-08 15:20
已编辑
University of Liverpool 运营
题解 | #浙江大学用户题目回答情况# 第一遍没做出来
解法1: select a.device_id, a.question_id, a.result from question_practice_detail as a, user_profile as b where a.device_id=b.device_id and b.university='浙江大学' 解法2: select a.device_id, a.question_id, a.result from question_practice_detail as a join user_profile as b #join或者left join都可以 on a.device_id=b...
0
点赞
评论
收藏
分享
2023-01-08 14:55
已编辑
University of Liverpool 运营
题解 | #分组过滤练习题# 两个注意事项
select university, avg(question_cnt) as avg_question_cnt, avg(answer_cnt) as avg_answer_cnt from user_profile group by university #按学校输出需分组:需要对每个学校统计其平均发贴数和平均回帖数 having avg_question_cnt < 5 or avg_answer_cnt < 20 #用having不用where:限定条件是avg(question_cnt)<5 or avg(answer_cnt)<20,聚合函数结果作为筛选条...
0
点赞
评论
收藏
分享
2023-01-08 13:53
University of Liverpool 运营
题解 | #分组计算练习题#
select gender, university, count(id), avg(active_days_within_30) as avg_active_day, avg(question_cnt) as avg_question_cnt from user_profile group by gender, university
0
点赞
评论
收藏
分享
1
2
3
4
创作者周榜
更多
关注他的用户也关注了:
牛客网
牛客企业服务