ongerd
ongerd
全部文章
分类
题解(4)
归档
标签
去牛客网
登录
/
注册
ongerd的博客
全部文章
(共10篇)
题解 | #某宝店铺连续2天及以上购物的用户及其对应的天数#
SELECT user_id,COUNT(1)days_count FROM( SELECT DISTINCT sales_date, user_id, DENSE_RANK()OVE...
2022-07-27
0
166
题解 | #某宝店铺动销率与售罄率#
此处分享一种容易出错的地方 ①首先,将product_tb和sales_tb关联,得到: 这里为了方便按照style_id进行排序,可以清楚地看到style_id = A的情况。此时,我们基于这个表开始计算需要的参数,就会开始出现错误。 ②例如,select style_i...
2022-07-26
0
153
题解 | #店铺901国庆期间的7日动销率和滞销率#
①首先,计算出店铺901一共有多少件已上架的商品。 select count(distinct product_id) from tb_product_info where shop_id = 901 ②根据题目条件,计算出每一件商品近七天内销售的天数。这里,涉及了一...
2022-07-05
0
157
题解 | #10月的新户客单价和获客成本#
select round(avg(total_amount), 1) as avg_amount, round(avg(cost_discount), 1) as avg_cost from ( select &nb...
2022-07-04
0
169
题解 | #某店铺的各商品毛利率及店铺整体毛利率#
按照题目给出的商品毛利率公式为:商品毛利率=(1-进价/平均单件售价)*100% 以商品8001为例,8001售出了3件,销售总额为25500,进价总额为18000,平均单件售价为8500,毛利率应该为(1-18000/8500)%吧,这不是跟解释那里不一样吗(笑哭),难道是我理解错了吗(沉思...
2022-07-02
0
277
题解 | #某店铺的各商品毛利率及店铺整体毛利率#
按照题目给出的商品毛利率公式为:商品毛利率=(1-进价/平均单件售价)*100% 以商品8001为例,8001售出了3件,销售总额为25500,进价总额为18000,平均单件售价为8500,毛利率应该为(1-18000/8500)%吧,这不是跟解释那里不一样吗(笑哭),难道是我理解错了吗(沉思...
2022-07-02
0
112
题解 | #平均播放进度大于60%的视频类别#
SELECT tag, CONCAT(ROUND(AVG(IF(TIMESTAMPDIFF(second,start_time,end_time)>duration,1,  ...
Mysql
2022-05-20
0
134
题解 | #各个视频的平均完播率#
select video_id, round(count(case when end_time-start_time >= duration the...
Mysql
2022-05-19
0
228
题解 | #统计复旦用户8月练题情况#
select distinct device_id, university, count(question_id) as question_cnt, sum( case when result = 'right' then 1 else 0 end) as right_question_cnt fr...
Mysql
2022-05-17
0
198
题解 | #浙江大学用户题目回答情况#
select device_id,question_id,result from question_practice_detail join user_profile using (device_id) where university ='浙江大学' 当两个表的列名称一致时,用using()会比较...
Mysql
2022-05-13
0
136