- 查询不在表里的数据,一张学生表,一张学生的选课表,要求查出没有选课的学生?
select students.student_name from students left join course_selection on students.student_id=course_selection.student_id where course_selection.student_id is null

- 查找第N高的数据,查找课程编号为”01“的成绩第三高的学生,如果不存在则返回null
select IFNULL((select scores.score from scores order by scores.score desc limit 1 offset 2) ,null) as "第三高的成绩"
- 分组排序,按成绩从大到小排序如80,80,76,70,50 对应的排序为1,1,3,4,5
select *,RANK() over(ORDER BY scores.score DESC) as "排名" from scores


- 连续出现N次问题,学生连续3个学号相邻的学生出现年龄相同的年龄
select distinct a.age from students a,students b,students c where a.student_id=b.student_id+1 and b.student_id=c.student_id+1 and a.age=b.age and b.age=c.age

![P8651 [蓝桥杯 2017 省 B] 日期问题--注意日期问题中2月的天数 / if是否应该连用](https://i-blog.csdnimg.cn/direct/d7b8582f89164332873139dbbaa585f2.png)


![[含文档+PPT+源码等]精品基于Python实现的vue3+Django计算机课程资源平台](https://img-blog.csdnimg.cn/img_convert/1db1fd4398e7d71af2a7065bb4ac76eb.png)








![P8720 [蓝桥杯 2020 省 B2] 平面切分--set、pair](https://i-blog.csdnimg.cn/direct/63909a73603a4bcd9cfa909475ccdd36.png)





