array(2) { ["docs"]=> array(10) { [0]=> array(10) { ["id"]=> string(3) "428" ["text"]=> string(77) "Visual Studio 2017 单独启动MSDN帮助(Microsoft Help Viewer)的方法" ["intro"]=> string(288) "目录 ECharts 异步加载 ECharts 数据可视化在过去几年中取得了巨大进展。开发人员对可视化产品的期望不再是简单的图表创建工具,而是在交互、性能、数据处理等方面有更高的要求。 chart.setOption({ color: [ " ["username"]=> string(8) "DonetRen" ["tagsname"]=> string(55) "Visual Studio 2017|MSDN帮助|C#程序|.NET|Help Viewer" ["tagsid"]=> string(23) "[401,402,403,"300",404]" ["catesname"]=> string(0) "" ["catesid"]=> string(2) "[]" ["createtime"]=> string(10) "1511400964" ["_id"]=> string(3) "428" } [1]=> array(10) { ["id"]=> string(3) "427" ["text"]=> string(42) "npm -v;报错 cannot find module "wrapp"" ["intro"]=> string(288) "目录 ECharts 异步加载 ECharts 数据可视化在过去几年中取得了巨大进展。开发人员对可视化产品的期望不再是简单的图表创建工具,而是在交互、性能、数据处理等方面有更高的要求。 chart.setOption({ color: [ " ["username"]=> string(4) "zzty" ["tagsname"]=> string(50) "node.js|npm|cannot find module "wrapp“|node" ["tagsid"]=> string(19) "[398,"239",399,400]" ["catesname"]=> string(0) "" ["catesid"]=> string(2) "[]" ["createtime"]=> string(10) "1511400760" ["_id"]=> string(3) "427" } [2]=> array(10) { ["id"]=> string(3) "426" ["text"]=> string(54) "说说css中pt、px、em、rem都扮演了什么角色" ["intro"]=> string(288) "目录 ECharts 异步加载 ECharts 数据可视化在过去几年中取得了巨大进展。开发人员对可视化产品的期望不再是简单的图表创建工具,而是在交互、性能、数据处理等方面有更高的要求。 chart.setOption({ color: [ " ["username"]=> string(12) "zhengqiaoyin" ["tagsname"]=> string(0) "" ["tagsid"]=> string(2) "[]" ["catesname"]=> string(0) "" ["catesid"]=> string(2) "[]" ["createtime"]=> string(10) "1511400640" ["_id"]=> string(3) "426" } [3]=> array(10) { ["id"]=> string(3) "425" ["text"]=> string(83) "深入学习JS执行--创建执行上下文(变量对象,作用域链,this)" ["intro"]=> string(288) "目录 ECharts 异步加载 ECharts 数据可视化在过去几年中取得了巨大进展。开发人员对可视化产品的期望不再是简单的图表创建工具,而是在交互、性能、数据处理等方面有更高的要求。 chart.setOption({ color: [ " ["username"]=> string(7) "Ry-yuan" ["tagsname"]=> string(33) "Javascript|Javascript执行过程" ["tagsid"]=> string(13) "["169","191"]" ["catesname"]=> string(0) "" ["catesid"]=> string(2) "[]" ["createtime"]=> string(10) "1511399901" ["_id"]=> string(3) "425" } [4]=> array(10) { ["id"]=> string(3) "424" ["text"]=> string(30) "C# 排序技术研究与对比" ["intro"]=> string(288) "目录 ECharts 异步加载 ECharts 数据可视化在过去几年中取得了巨大进展。开发人员对可视化产品的期望不再是简单的图表创建工具,而是在交互、性能、数据处理等方面有更高的要求。 chart.setOption({ color: [ " ["username"]=> string(9) "vveiliang" ["tagsname"]=> string(0) "" ["tagsid"]=> string(2) "[]" ["catesname"]=> string(8) ".Net Dev" ["catesid"]=> string(5) "[199]" ["createtime"]=> string(10) "1511399150" ["_id"]=> string(3) "424" } [5]=> array(10) { ["id"]=> string(3) "423" ["text"]=> string(72) "【算法】小白的算法笔记:快速排序算法的编码和优化" ["intro"]=> string(288) "目录 ECharts 异步加载 ECharts 数据可视化在过去几年中取得了巨大进展。开发人员对可视化产品的期望不再是简单的图表创建工具,而是在交互、性能、数据处理等方面有更高的要求。 chart.setOption({ color: [ " ["username"]=> string(9) "penghuwan" ["tagsname"]=> string(6) "算法" ["tagsid"]=> string(7) "["344"]" ["catesname"]=> string(0) "" ["catesid"]=> string(2) "[]" ["createtime"]=> string(10) "1511398109" ["_id"]=> string(3) "423" } [6]=> array(10) { ["id"]=> string(3) "422" ["text"]=> string(64) "JavaScript数据可视化编程学习(二)Flotr2,雷达图" ["intro"]=> string(288) "目录 ECharts 异步加载 ECharts 数据可视化在过去几年中取得了巨大进展。开发人员对可视化产品的期望不再是简单的图表创建工具,而是在交互、性能、数据处理等方面有更高的要求。 chart.setOption({ color: [ " ["username"]=> string(7) "chengxs" ["tagsname"]=> string(28) "数据可视化|前端学习" ["tagsid"]=> string(9) "[396,397]" ["catesname"]=> string(18) "前端基本知识" ["catesid"]=> string(5) "[198]" ["createtime"]=> string(10) "1511397800" ["_id"]=> string(3) "422" } [7]=> array(10) { ["id"]=> string(3) "421" ["text"]=> string(36) "C#表达式目录树(Expression)" ["intro"]=> string(288) "目录 ECharts 异步加载 ECharts 数据可视化在过去几年中取得了巨大进展。开发人员对可视化产品的期望不再是简单的图表创建工具,而是在交互、性能、数据处理等方面有更高的要求。 chart.setOption({ color: [ " ["username"]=> string(4) "wwym" ["tagsname"]=> string(0) "" ["tagsid"]=> string(2) "[]" ["catesname"]=> string(4) ".NET" ["catesid"]=> string(7) "["119"]" ["createtime"]=> string(10) "1511397474" ["_id"]=> string(3) "421" } [8]=> array(10) { ["id"]=> string(3) "420" ["text"]=> string(47) "数据结构 队列_队列实例:事件处理" ["intro"]=> string(288) "目录 ECharts 异步加载 ECharts 数据可视化在过去几年中取得了巨大进展。开发人员对可视化产品的期望不再是简单的图表创建工具,而是在交互、性能、数据处理等方面有更高的要求。 chart.setOption({ color: [ " ["username"]=> string(7) "idreamo" ["tagsname"]=> string(40) "C语言|数据结构|队列|事件处理" ["tagsid"]=> string(23) "["246","247","248",395]" ["catesname"]=> string(12) "数据结构" ["catesid"]=> string(7) "["133"]" ["createtime"]=> string(10) "1511397279" ["_id"]=> string(3) "420" } [9]=> array(10) { ["id"]=> string(3) "419" ["text"]=> string(47) "久等了,博客园官方Android客户端发布" ["intro"]=> string(288) "目录 ECharts 异步加载 ECharts 数据可视化在过去几年中取得了巨大进展。开发人员对可视化产品的期望不再是简单的图表创建工具,而是在交互、性能、数据处理等方面有更高的要求。 chart.setOption({ color: [ " ["username"]=> string(3) "cmt" ["tagsname"]=> string(0) "" ["tagsid"]=> string(2) "[]" ["catesname"]=> string(0) "" ["catesid"]=> string(2) "[]" ["createtime"]=> string(10) "1511396549" ["_id"]=> string(3) "419" } } ["count"]=> int(200) } 222 SQL语句测试 - 爱码网

SQL语句测试

SQL语句测试

班级表    学生表    分数表    课程表    老师表
前提:
    1. 一个班级具有多个学生
    2. 分数应该体现学生对应的课程
    3. 一个老师可以带多个班级
sql语句执行顺序:
	1、from
	2、where
	3、group by ··· having
	4、聚合函数
	5、select查询语句
	6、order by排序语句
	···
# 1 查询所有课程(course)以及对应老师(teacher)的名称
select cname, tname from course left join teacher on course.teacher_id = teacher.tid;
# left join: 左侧有的全显示,左侧没有的不显示,链接关系为外键字段
# 2 查询学生表(student)中男女生各有多少人
select gender, count(sid) from student group by gender;
# group by: 以某个字段进行分组,count对分组内容进行统计
# 3 查询物理(course)成绩(score)等于100的学生(student)姓名
select sname from student where sid in (select student_id from score where course_id = (select cid from course where cname = '物理') and num = 100)
# 子查询: 1. 查找物理课程 2. 查看分数等于100的1 3. 查询获取该分数的学生姓名
# 4 查询平均成绩(score)大于80分的同学(student)的姓名跟平均成绩
select sname, st.avg_num from student inner join (select student_id, avg(num) avg_num from score group by student_id having avg(num) > 80) as st on student.sid = score.student_id;
# 查询平均成绩大于80分的同学id inner join 与之关联查看学生姓名
# 5 查询所有学生(student)的学号,姓名,选课数(course),总成绩(score)
select sid 学号, sname 姓名, count_course_id 选课数, sum_num 总成绩 from student inner join (select student_id, count(course_id) count_course_id, sum(num) sum_num from score group by student_id) as st on student.sid = st.student_id;
# 根据学生分组查询选课数,总成绩,inner join与之关联查看学生学号,姓名
# 6 查询李姓老师(teacher)的个数
select count(tid) from teacher where tname like '李%';
# 模糊匹配过滤查找
# 7 查询没有报李平老师(teacher)课程(course)的学生(student)姓名
select sname from student where sid not in (select distinct student_id from score where course_id in (select cid from course where teacher_id = (select tid from teacher where tname = '李平老师')))
# 查看学生姓名 not in(报选 李平老师的课程的学生)
# 8 查询物理课程(course)比生物课程分数(score)高的学生学号跟姓名
select t1.student_id from (select student_id, num from score inner join course on score.course_id = course.cid where course.cname = '物理') as t1 inner join (select student_id, num from score inner join course on score.course_id = course.cid where course.cname = '生物') as t2 on t1.student_id = t2.student_id where t1.num > t2.num;
# 分别查询物理成绩跟生物成绩。inner join 比较
# 9 查询没有同时(score)选修物理课程(course)跟体育课程的学生(student)姓名
select sname from student where sid in (select student_id from score inner join course on course.cid = socre.course_id and course.cname in ('物理', '体育')  group by student_id having count(course_id) = 1);
# 查询符合规则的学生姓名(选修了一门课程的学生)
# 10 查询挂科超过两门(course)的学生姓名(student)和班级(class)
select t2.sname, class.caption from (select sname, class_id from student inner join (select student_id from score where num < 60 group by student_id having count(course_id) >= 2) as t1 on student.sid = t1.student_id ) as t2 inner join class on class.cid = t2.class_id;
# 
# 11 查询选修了所有课程(course)的学生姓名(student)
select sname from student inner join (select student_id from score group by student_id having count(course_id) = (select count(cid) from course )) as t1 on t1.student_id = student.sid;
# 
# 12 查询李平老师(student)教的课程(course)的所有成绩(score)记录
# 13 查询全部学生(student)都选修了的课程号跟课程名(course)
# 14 查询每门课程(course)被选修的次数(score)
# 15 查询只选修了一门课程(course)的学生(student)的学号跟姓名
# 16 查询所有学生(student)考出的成绩(score)并从高到低排序(去重)
# 17 查询平均成绩(score)大于85的学生(student)姓名跟平均成绩
# 18 查询生物(course)成绩(score)不及格的学生(student)姓名和对应的生物分数
# 19 查询所有选修了李平(teacher)老师课程(course)的学生(student)中,这些课程(李平老师的课程)平均成绩最高的学生姓名
# 20 查询每门课程成绩(score)最好的前两名学生(student)姓名
# 21 查询不同课程但成绩(score)相同的学号,课程号,成绩
# 22 查询没学过“叶平”老师(teacher)课程的学生(student)姓名以及选修的课程(course)名称;
# 23 查询所有选修了学号为1的同学选修过的一门或者多门课程的同学学号和姓名
# 24 任课最多的老师中学生单科成绩最高的学生姓名
https://tool.lu/
https://cli.im/
https://0x3.com/
https://www.uupoop.com/
https://www.hipdf.cn/
https://showmore.com/zh/
http://weibodang.cn/

相关文章:

  • 2021-09-24
  • 2019-12-09
  • 2021-11-14
  • 2018-06-20
  • 2018-12-19
猜你喜欢
  • 2020-12-24
  • 2019-02-25
  • 2021-08-14
  • 2018-10-10
  • 2021-12-15
  • 2021-11-14
  • 2018-07-31
  • 2021-08-04
相关资源
相似解决方案