夜的第九章
夜的第九章
全部文章
分类
题解(59)
归档
标签
去牛客网
登录
/
注册
夜的第九章的博客
全部文章
(共53篇)
题解 | #最差是第几名(一)#
1.分析 sum over用法,先对grade排序,然后依次计算各个sum。 2.代码 select grade, sum(number) over(order by grade) t_rank from class_grade order by grade;
2021-09-13
0
248
题解 | #实习广场投递简历分析(二)#
1.分析 date_format函数:DATE_FORMAT(date,format) 可以使用的格式有: %Y --年,4 位 %m --月,数值(00-12) %M --月名 %k --小时(0-23) like 匹配 排序...
2021-09-13
0
231
题解 | #牛客的课程订单分析(六)#
1.分析 右连接+窗口函数 2.代码 select t2.id,t2.is_group_buy,t1.name as client_name from client t1 right join ( select *,count(id) over(partition by user_id...
2021-09-13
0
212
题解 | #牛客的课程订单分析(三)#
1.2025-10-15之后,同一个用户下单状态为购买成功的C++,java,python的订单信息 # SELECT * # FROM order_info # WHERE status = "completed" # and product_name IN ("C...
2021-09-13
0
267
题解 | #牛客的课程订单分析(二)#
1.同一个用户下单2个及2个以上状态为购买成功的用户id #select user_id #from order_info #where status = "completed" #group by user_id #having count(user_id) >= 22...
2021-09-13
0
300
题解 | #考试分数(二)#
1、求解平均分 select b.job,avg(b.score) as pp from grade b group by b.job2、查找所有的id,job,以及分数 select a.id ,a.job,a.score from grade a3、左连接+筛选(高于平均值) select a....
2021-09-13
0
307
题解 | #刷题通过的题目排名#
1.分析 count计数的时候要去重,两个排序。 2.代码 select p1.id ,p1.number, (select count(distinct p2.number) from passing_number as p2 where p2.number >= p1.number)...
2021-09-13
1
283
题解 | #使用含有关键字exists查找未分配具体部门的员工的所有信息。#
1.分析 2.代码 select * from employees e where not exists (select emp_no from dept_emp d where d.emp_no = e.emp_no);
2021-09-13
0
249
题解 | #分页查询employees表,每5行一页,返回第2页的数据#
1.分析 若每页显示n条记录,要显示第i页数据,则可以用 limit n*(i-1),n2.代码 select * from employees limit 5,5;
2021-09-13
0
243
题解 | #查找排除当前最大、最小salary之后的员工的平均工资avg_salary#
1.分析 三个条件依次写出。 2.代码 select avg(salary) as avg_salary from salaries where to_date = '9999-01-01' and salary not in (select max(salary) from salaries...
2021-09-13
0
240
首页
上一页
1
2
3
4
5
6
下一页
末页