JJJENNN
JJJENNN
全部文章
分类
归档
标签
去牛客网
登录
/
注册
JJJENNN的博客
全部文章
(共38篇)
题解 | 统计各岗位员工平均工作时长
SELECT st.post, ROUND(AVG(TIMESTAMPDIFF(second,first_clockin,last_clockin)/3600),3) AS work_hours FROM staff_tb st JOIN attendent_tb at USING ...
2026-02-13
0
33
题解 | 每个商品的销售总额
SELECT p.name AS product_name, SUM(o.quantity) AS total_sales, RANK() OVER(partition by p.category order by SUM(o.quantity) DESC) AS categ...
2026-02-10
0
27
题解 | 推荐内容准确的用户平均评分
SELECT ROUND(AVG(score),3) AS avg_score FROM user_action_tb WHERE user_id IN ( SELECT DISTINCT user_id FROM recommend_tb rt JOIN user_a...
2026-02-10
0
34
题解 | 查询培训指定课程的员工信息
SELECT staff_id, staff_name FROM staff_tb st JOIN cultivate_tb ct USING (staff_id) WHERE ct.course LIKE "%course3%"
2026-02-10
0
24
题解 | 统计所有课程参加培训人次
SELECT SUM( CASE WHEN length(course) = 7 THEN 1 WHEN length(course) = 15 THEN 2 WHEN length(course) = ...
2026-02-10
0
24
题解 | 查询连续入住多晚的客户信息?
SELECT ct.user_id, ct.room_id, gt.room_type, DATEDIFF(ct.checkout_time, ct.checkin_time) AS days FROM checkin_tb ct JOIN guest...
2026-02-09
0
28
题解 | 获取指定客户每月的消费额
SELECT DATE_FORMAT(t.t_time, '%Y-%m') AS time, ROUND(SUM(t.t_amount),1) AS total FROM trade t JOIN customer c ON t.t_cus = c.c_id WHERE c.c_id = ...
2026-02-09
0
31
题解 | 获取指定客户每月的消费额
SELECT DATE_FORMAT(t.t_time, '%Y-%m') AS time, ROUND(SUM(t.t_amount),1) AS total FROM trade t JOIN customer c ON t.t_cus = c.c_id WHERE c.c_id = ...
2026-02-09
0
24
首页
上一页
1
2
3
4
下一页
末页