风流倜傥三金老师
风流倜傥三金老师
全部文章
分类
归档
标签
去牛客网
登录
/
注册
风流倜傥三金老师的博客
全部文章
(共53篇)
题解 | 查询出不同类别商品中,销售金额排名前三且利润率超过 20%的商品信息
WITH t1 AS ( -- 清洗数据,关联两表,得出包含所需数据的底表 SELECT sp.product_id, sp.product_name, sp.category_id, SUM(ll.sales_amount) AS total_sales_...
2025-11-18
0
30
题解 | 分析每个商品在不同时间段的销售情况
/* ①商品ID:product_id ②商品名称:product_name ③2024年第二季度的销售总额:q2_2024_sales_total ④在所属类别的销售排名:category_rank ⑤所属供应商:supplier_name */ WITH t1 AS ( -- 链接三表...
2025-11-18
0
29
题解 | 电商平台想要了解不同商品在不同月份的销售趋势
/* 输出: product_name: 商品的名称。 total_sales: 2024 年上半年(1-6月份)的总销售量。 max_monthly_sales:2024 年上半年(1-6月份)的总销售量销量最高的月份的销量 min_monthly_sales:2024 年上半年(1-6月份)的总...
2025-11-15
0
35
题解 | 电商平台需要对商家的销售业绩、退款情况和客户满意度进行综合评估
WITH t1 AS ( -- 计算商家总销售额 SELECT merchant_id, SUM(sale_amount) AS total_sales_amount FROM sales_underline GROUP BY merc...
2025-11-15
0
22
题解 | 统计快递运输时长
SELECT a.exp_type, ROUND(AVG(TIMESTAMPDIFF(SECOND,b.out_time,b.in_time) / 3600),1) AS time FROM express_tb AS a INNER JOIN exp_action_tb AS b ...
2025-11-12
0
26
题解 | 查询产生理赔费用的快递信息
SELECT a.exp_number, a.exp_type, b.claims_cost FROM express_tb AS a INNER JOIN exp_cost_tb AS b ON a.exp_number = b.exp_number WHERE b...
2025-11-12
0
22
题解 | 最受欢迎的top3课程
WITH t1 AS ( -- 计算出每个课程发布后的7天是哪几天 SELECT a.cid, a.start_time, a.end_time, score, DATE_ADD(b.release_da...
2025-11-12
0
29
题解 | 更新员工信息表
WITH t1 AS ( -- 自连接所有新老职位信息 SELECT EMPLOYEE_ID, LAST_UPDATE_DT AS sj, POSITION AS zw FROM EMPLOYEE_INFO UNION ALL SELECT EMPLOY...
2025-11-11
0
25
题解 | 未下单用户登陆渠道统计
SELECT b.channel, COUNT(DISTINCT b.uid) AS cnt FROM order_log AS a RIGHT JOIN user_info AS b ON a.uid = b.uid WHERE a.uid IS NULL GROUP BY...
2025-11-11
0
34
题解 | 用户订单信息查询
SELECT b.city, SUM(a.total_amount) AS total_order_amount FROM orders AS a INNER JOIN customers AS b ON a.customer_id = b.customer_id GROUP...
2025-11-11
0
23
首页
上一页
1
2
3
4
5
6
下一页
末页