牛客145560421号
牛客145560421号
全部文章
分类
题解(16)
归档
标签
去牛客网
登录
/
注册
牛客145560421号的博客
全部文章
(共19篇)
题解 | #统计复旦用户8月练题情况#
select device_id,university,count(question_id) ques_count, count(if(result = 'right','right',null)) right_count from( select up.device_id, up.univers...
2023-11-16
0
106
题解 | #计算25岁以上和以下的用户数量#
select case when age is null OR age < 25 then '25岁以下' when age >= 25 then '25岁及以上' end as age_cut, count(ifnull(age,0)) from user_profile grou...
2023-11-15
0
93
题解 | #查找山东大学或者性别为男生的信息#
select device_id, gender, age, gpa from user_profile where university = '山东大学' union all select device_id, gender, age, gpa from user_profile where g...
2023-11-15
0
84
题解 | #统计每个用户的平均刷题数#
select up.university, qd.difficult_level, count(qpd.question_id)/count(distinct up.device_id) avg_cnt from user_profile up inner join question_prac...
2023-11-15
0
91
题解 | #统计每个学校各难度的用户平均刷题数#
select up.university, qd.difficult_level, count(qpd.question_id)/count(distinct up.device_id) avg_answer_cnt from user_profile up inner join questi...
2023-11-15
0
96
题解 | #统计每个学校的答过题的用户的平均答题数#
select up.university, count(qpd.question_id) / count(distinct up.device_id) avg_answer_cnt from user_profile up inner join question_practice_detail qp...
2023-11-15
0
100
题解 | #分组过滤练习题#
select university, avg(question_cnt) avg_question_cnt, avg(answer_cnt) avg_answer_cnt from user_profile group by university having...
2023-11-15
0
78
题解 | #分组计算练习题#
select gender, university, count(id) user_num, avg(active_days_within_30), avg(question_cnt) from user_profile group by gender, university 根据性别(gender...
2023-11-15
0
76
题解 | #出现三次以上相同积分的情况#
学习新知识点replace replace(object,serch,replace) 将object中的serch替换为replace 本题中使用replace将emp_no字段中的10001替换为10005,条件是id=5
MySQL
where
replace
update
set
2021-07-14
0
346
题解 | #考试分数(二)#
查询的是所在职业分数大于该职业平均分的成绩信息首先,查询出各个职业及其平均分,作为t2表,使用grade表通过job连接t2加上条件,即t1.job = t2.job and t1.score > t2.avg_score最后对id升序select t1.id,t1.job,t1.scoref...
MySQL
orderBy
groupBy
avg
join
2021-07-13
1
337
首页
上一页
1
2
下一页
末页