JanisZhan
JanisZhan
全部文章
分类
题解(47)
归档
标签
去牛客网
登录
/
注册
JanisZhan的博客
全部文章
(共35篇)
题解 | #平均活跃天数和月活人数#
select date_format(submit_time,'%Y%m') as month, round((count(distinct uid,date_format(submit_time,'%y%m%d')))/count(distinct uid),2) as avg_activ...
Mysql
2022-07-07
1
171
题解 | #统计作答次数#
select count(*) as total_pv,count(submit_time) as complete_pv, count(distinct exam_id and submit_time is not null and score is not ...
Mysql
2022-07-06
0
149
题解 | #SQL类别高难度试卷得分的截断平均值#
思路:将表中各科目的最大值和最小值选出组合,然后筛选出分数值不是最值表中的 可以确保所有的最大值和最小值排除,避免出现多人同为未全部排除的情况 select ei.tag,ei.difficulty,round(avg(er.score),1) as clip_avg_score from exam...
Mysql
2022-07-06
6
258
题解 | #某乎问答回答过教育类问题的用户里有多少用户回答过职场类问题#
select count(distinct author_id) as nun from answer_tb a left outer join issue_tb i on i.issue_id=a.issue_id where i.issue_type='Career' and ...
Mysql
2022-07-01
0
171
题解 | #某乎问答单日回答问题数大于等于3个的所有用户#
要按时间(先)和作者ID排序 升序 select answer_date,author_id,count(author_id) as answer_cnt from answer_tb where month(answer_date)=11 group by author_id,answer_da...
2022-07-01
1
185
题解 | #某乎问答11月份日人均回答量#
select answer_date,round(count(issue_id)/count(distinct author_id),2) as per_num from answer_tb group by answer_date order by answer_date asc
Mysql
2022-07-01
1
191
题解 | #牛客直播转换率#
select b.course_id,c.course_name,round(sum(b.if_sign)*100/sum(b.if_vw),2) as 'sign_rate(%)' from course_tb c right outer join behavior_tb b on ...
Mysql
2022-07-01
1
194
题解 | #某宝店铺折扣率#
tag_price只是单价要记得乘数量 select round(sum(s.sales_price)*100/sum(s.sales_num*p.tag_price),2) as 'discount_rate(%)' from sales_tb s left outer join product_...
Mysql
2022-07-01
4
290
题解 | #某宝店铺的实际销售额与客单价#
select sum(sales_price) as sales_total, round(sum(sales_price)/count(distinct user_id),2) as per...
Mysql
2022-07-01
0
174
题解 | #某宝店铺的SPU数量#
select style_id,count(style_id) as SPU_num from product_tb group by style_id order by SPU_num desc
Mysql
2022-07-01
3
231
首页
上一页
1
2
3
4
下一页
末页