OkMaid
OkMaid
全部文章
分类
题解(34)
归档
标签
去牛客网
登录
/
注册
OkMaid的博客
全部文章
(共68篇)
题解 | #提取博客URL中的用户名#
select device_id, substring_index(blog_url, '/', -1) as user_name from user_submit 和上一题一样用到 su...
Mysql
2022-05-24
0
281
题解 | #截取出年龄#
```select substring_index(substring_index(profile, ',', -2), ',', 1) as age, count(device_id) as number from user_submit group by age substr...
Mysql
2022-05-24
0
329
题解 | #统计每种性别的人数#
第一种比较笨笨 ```select 'female' as gender, count(*) as number from user_submit where profile like '%female' union all select 'm...
Mysql
2022-05-24
0
291
题解 | #计算用户8月每天的练题数量#
```select day(date) as day, count(question_id) as question_cnt from question_practice_detail where month(date) = 08 and year(date) = 2021 group by dat...
Mysql
2022-05-24
0
250
题解 | #计算25岁以上和以下的用户数量#
```select '25岁以下' as age_cut, count(device_id) as number from user_profile where age < 25 or age is null union select '25岁及以上' as age_cut, count(de...
Mysql
2022-05-24
0
296
题解 | #查找山东大学或者性别为男生的信息#
学会了 union all是可以不去重的!! 感谢大佬 select device_id, gender, age, gpa from user_profile where university='山东大学' union all select device_id, gende...
Mysql
2022-05-24
0
299
题解 | #统计每个学校各难度的用户平均刷题数#
select u.university, qd.difficult_level, count(qpd.question_id) / count(distinct qpd.device_id) as avg_answer_cnt from question_practice_detail qpd jo...
Mysql
2022-05-23
0
570
题解 | #统计每个学校的答过题的用户的平均答题数#
select u.university, count(question_id) / count(distinct u.device_id) as avg_answer_cnt from user_profile u right join question_practice_detail q on u...
Mysql
2022-05-23
0
290
首页
上一页
1
2
3
4
5
6
7
下一页
末页