大数据技术之Hive SQL题库-初级
第一章环境准备
1.1 建表语句
hive>
-- 创建学生表
DROP TABLE IF EXISTS student;
create table if not exists student_info(stu_id string COMMENT '学生id',stu_name string COMMENT '学生姓名',birthday string COMMENT '出生日期',sex string COMMENT '性别'
)
row format delimited fields terminated by ','
stored as textfile;-- 创建课程表
DROP TABLE IF EXISTS course;
create table if not exists course_info(course_id string COMMENT '课程id',course_name string COMMENT '课程名',tea_id string COMMENT '任课老师id'
)
row format delimited fields terminated by ','
stored as textfile;-- 创建老师表
DROP TABLE IF EXISTS teacher;
create table if not exists teacher_info(tea_id string COMMENT '老师id',tea_name string COMMENT '老师姓名'
)
row format delimited fields terminated by ','
stored as textfile;-- 创建分数表
DROP TABLE IF EXISTS score;
create table if not exists score_info(stu_id string COMMENT '学生id',course_id string COMMENT '课程id',score int COMMENT '成绩'
)
row format delimited fields terminated by ','
stored as textfile;
1.2 数据准备
(1)创建/opt/module/data目录
[atguigu@hadoop102 module]$ mkdir data
(2)将如4个文件放到/opt/module/data目录下(数据内容如第三点所示)
(3)数据样式说明
[atguigu@hadoop102 data]$ vim student_info.txt
001,彭于晏,1995-05-16,男
002,胡歌,1994-03-20,男
003,周杰伦,1995-04-30,男
004,刘德华,1998-08-28,男
005,唐国强,1993-09-10,男
006,陈道明,1992-11-12,男
007,陈坤,1999-04-09,男
008,吴京,1994-02-06,男
009,郭德纲,1992-12-05,男
010,于谦,1998-08-23,男
011,潘长江,1995-05-27,男
012,杨紫,1996-12-21,女
013,蒋欣,1997-11-08,女
014,赵丽颖,1990-01-09,女
015,刘亦菲,1993-01-14,女
016,周冬雨,1990-06-18,女
017,范冰冰,1992-07-04,女
018,李冰冰,1993-09-24,女
019,邓紫棋,1994-08-31,女
020,宋丹丹,1991-03-01,女
[atguigu@hadoop102 data]$ vim course_info.txt
01,语文,1003
02,数学,1001
03,英语,1004
04,体育,1002
05,音乐,1002
[atguigu@hadoop102 data]$ vim teacher_info.txt
1001,张高数
1002,李体音
1003,王子文
1004,刘丽英
[atguigu@hadoop102 data]$ vim score_info.txt
001,01,94
002,01,74
004,01,85
005,01,64
006,01,71
007,01,48
008,01,56
009,01,75
010,01,84
011,01,61
012,01,44
013,01,47
014,01,81
015,01,90
016,01,71
017,01,58
018,01,38
019,01,46
020,01,89
001,02,63
002,02,84
004,02,93
005,02,44
006,02,90
007,02,55
008,02,34
009,02,78
010,02,68
011,02,49
012,02,74
013,02,35
014,02,39
015,02,48
016,02,89
017,02,34
018,02,58
019,02,39
020,02,59
001,03,79
002,03,87
004,03,89
005,03,99
006,03,59
007,03,70
008,03,39
009,03,60
010,03,47
011,03,70
012,03,62
013,03,93
014,03,32
015,03,84
016,03,71
017,03,55
018,03,49
019,03,93
020,03,81
001,04,54
002,04,100
004,04,59
005,04,85
007,04,63
009,04,79
010,04,34
013,04,69
014,04,40
016,04,94
017,04,34
020,04,50
005,05,85
007,05,63
009,05,79
015,05,59
018,05,87
1.3 插入数据
(1)插入数据
hive>
load data local inpath '/opt/module/data/student_info.txt' into table student_info;
load data local inpath '/opt/module/data/course_info.txt' into table course_info;
load data local inpath '/opt/module/data/teacher_info.txt' into table teacher_info;
load data local inpath '/opt/module/data/score_info.txt' into table score_info;
骚戴理解:(这里我不能通过下面的命令加载数据到hive数据库,我是直接把数据上传到hdfs对应的路径下)
hive>desc formatted teacher_info //查看这个表在hdfs中的存储路径
![](https://img-blog.csdnimg.cn/img_convert/6690ab86276f450f932cb52171543123.png)
在把本地的teacher_info.txt上传到hdfs上面
[hive@node181 data]$ hdfs dfs -put teacher_info.txt hdfs://node181.hadoop.com:8020/warehouse/tablespace/managed/hive/teacher_info
(2)验证插入数据情况
hive>
select * from student_info limit 5;
select * from course_info limit 5;
select * from teacher_info limit 5;
select * from score_info limit 5;
第二章简单查询
2.1 查找特定条件
2.1.1 查询姓名中带“冰”的学生名单
hive>
select*
from student_info
where stu_name like "%冰%";
结果
stu_id stu_name birthday sex
017 范冰冰 1992-07-04 女
018 李冰冰 1993-09-24 女
2.1.2 查询姓“王”老师的个数
hive>
select count(*) wang_count
from teacher_info
where tea_name like '王%';
结果
wang_count
1
2.1.3 检索课程编号为“04”且分数小于60的学生的课程信息,结果按分数降序排列
hive>
selectstu_id,course_id,score
from score_info
where course_id ='04' and score<60
order by score desc;
结果
stu_id course_id score
004 04 59
001 04 54
020 04 50
014 04 40
017 04 34
010 04 34
2.1.4 查询数学成绩不及格的学生和其对应的成绩,按照学号升序排序
hive>
selects.stu_id,s.stu_name,t1.score
from student_info s
join (select*from score_infowhere course_id=(select course_id from course_info where course_name='数学') and score < 60) t1 on s.stu_id = t1.stu_id
order by s.stu_id;骚戴解法
select si.stu_id ,si.stu_name ,si2.score
from student_info si inner join score_info si2 on si.stu_id =si2 .stu_id
where si2.score <60 and si2.course_id ='02'
order by si.stu_id;
结果
s.stu_id s.stu_name t1.score
005 唐国强 44
007 陈坤 55
008 吴京 34
011 潘长江 49
013 蒋欣 35
014 赵丽颖 39
015 刘亦菲 48
017 范冰冰 34
018 李冰冰 58
019 邓紫棋 39
020 宋丹丹 59
第三章汇总分析
3.1 汇总分析
3.1.1 查询编号为“02”的课程的总成绩
hive>
selectcourse_id,sum(score) score_sum
from score_info
where course_id='02'
group by course_id;
骚戴理解:这里我忘记分组了,group by course_id要写
结果
course_id score_sum
02 1133
3.1.2 查询参加考试的学生个数
思路:对成绩表中的学号做去重并count
hive>
selectcount(distinct stu_id) stu_num
from score_info;
结果
stu_num
19
3.2 分组
3.2.1 查询各科成绩最高和最低的分,以如下的形式显示:课程号,最高分,最低分
思路:按照学科分组并使用max和min。
hive>
selectcourse_id,max(score) max_score,min(score) min_score
from score_info
group by course_id;
结果
course_id max_score min_score
01 94 38
02 93 34
03 99 32
04 100 34
05 87 59
3.2.2 查询每门课程有多少学生参加了考试(有考试成绩)
hive>
selectcourse_id,count(stu_id) stu_num
from score_info
group by course_id;
结果
course_id stu_num
01 19
02 19
03 19
04 12
05 5
3.2.3 查询男生、女生人数
hive>
selectsex,count(stu_id) count
from student_info
group by sex;
结果
sex count
女 9
男 11
3.3 分组结果的条件
3.3.1 查询平均成绩大于60分的学生的学号和平均成绩
1)思路分析
(1)平均成绩:展开来说就是计算每个学生的平均成绩
(2)这里涉及到“每个”就是要分组了
(3)平均成绩大于60分,就是对分组结果指定条件
(4)首先要分组求出每个学生的平均成绩,筛选高于60分的,并反查出这批学生,统计出这些学生总的平均成绩。
2)Hql实操
hive>
selectstu_id,avg(score) score_avg
from score_info
group by stu_id
having score_avg > 60;
骚戴理解:having是对分组聚合后的结果进行判断比较,where是对每条数据进行判断比较
结果
stu_id score_avg
001 72.5
002 86.25
004 81.5
005 75.4
006 73.33333333333333
009 74.2
013 61.0
015 70.25
016 81.25
020 69.75
3.3.2 查询至少选修四门课程的学生学号
1)思路分析
(1)需要先计算出每个学生选修的课程数据,需要按学号分组
(2)至少选修两门课程:也就是每个学生选修课程数目>=4,对分组结果指定条件
2)Hql实操
hive>
selectstu_id,count(course_id) course_count
from score_info
group by stu_id
having course_count >=4;骚戴解法:
select stu_id
from score_info
group by stu_id
having count(course_id)>=4;
骚戴理解:这里可发现聚合函数可以直接在having后面使用!
结果
stu_id course_num
001 4
002 4
004 4
005 5
007 5
009 5
010 4
013 4
014 4
015 4
016 4
017 4
018 4
020 4
3.3.3 查询同姓(假设每个学生姓名的第一个字为姓)的学生名单并统计同姓人数大于等于2的姓
思路:先提取出每个学生的姓并分组,如果分组的count>=2则为同姓
hive>
selectt1.first_name,count(*) count_first_name
from (selectstu_id,stu_name,substr(stu_name,0,1) first_namefrom student_info
) t1
group by t1.first_name
having count_first_name >= 2;
骚戴理解:这里是通过子查询来实现的,多看看来理解子查询的妙处
结果
t1.first_name count_first_name
刘 2
周 2
陈 2
3.3.4 查询每门课程的平均成绩,结果按平均成绩升序排序,平均成绩相同时,按课程号降序排列
思路:按照课程号分组并求组内的平均值
hive>
selectcourse_id,avg(score) score_avg
from score_info
group by course_id
order by score_avg asc, course_id desc;
结果
course_id score_avg
02 59.63157894736842
04 63.416666666666664
01 67.15789473684211
03 69.42105263157895
05 74.6
3.3.5 统计参加考试人数大于等于15的学科
按课程分组并统计组内人数,过滤条件大于等于15
hive>
selectcourse_id,count(stu_id) stu_count
from score_info
group by course_id
having stu_count >= 15;
结果
course_id stu_count
01 19
02 19
03 19
3.4 查询结果排序&分组指定条件
3.4.1 查询学生的总成绩并按照总成绩降序排序
思路:分组、sum、排序
hive>
selectstu_id,sum(score) sum_score
from score_info
group by stu_id
order by sum_score desc;
结果
stu_id sum_score
005 377
009 371
002 345
004 326
016 325
007 299
001 290
015 281
020 279
013 244
010 233
018 232
006 220
014 192
017 181
012 180
011 180
019 178
008 129
*3.4.2 按照如下格式显示学生的语文、数学、英语三科成绩,没有成绩的输出为0,按照学生的有效平均成绩降序显示
学生id 语文 数学 英语 有效课程数 有效平均成绩
hive>
selectsi.stu_id,sum(if(ci.course_name='语文',score,0)) `语文`,sum(if(ci.course_name='数学',score,0)) `数学`,sum(if(ci.course_name='英语',score,0)) `英语`,count(*) `有效课程数`,avg(si.score) `平均成绩`
fromscore_info si
joincourse_info ci
onsi.course_id=ci.course_id
group bysi.stu_id
order by`平均成绩` desc
结果
学生id 语文 数学 英语 有效课程数 平均成绩
002 74 84 87 4 86.25
004 85 93 89 4 81.5
016 71 89 71 4 81.25
005 64 44 99 5 75.4
009 75 78 60 5 74.2
006 71 90 59 3 73.33333333333333
001 94 63 79 4 72.5
015 90 48 84 4 70.25
020 89 59 81 4 69.75
013 47 35 93 4 61.0
012 44 74 62 3 60.0
011 61 49 70 3 60.0
007 48 55 70 5 59.8
019 46 39 93 3 59.333333333333336
010 84 68 47 4 58.25
018 38 58 49 4 58.0
014 81 39 32 4 48.0
017 58 34 55 4 45.25
008 56 34 39 3 43.0
*3.4.3 查询一共参加三门课程且其中一门为语文课程的学生的id和姓名
hive>
selectt2.stu_id,s.stu_name
from (select t1.stu_idfrom (select stu_id,course_idfrom score_infowhere stu_id in (select stu_idfrom score_infowhere course_id = "01")) t1group by t1.stu_idhaving count(t1.course_id) = 3) t2
join student_info s on t2.stu_id = s.stu_id;
结果
t2.stu_id s.stu_name
006 陈道明
008 吴京
011 潘长江
012 杨紫
019 邓紫棋
第四章复杂查询
4.1 子查询
4.1.1 查询所有课程成绩均小于60分的学生的学号、姓名
hive>
select s.stu_id,s.stu_name
from (select stu_id,sum(if(score >= 60, 1, 0)) flagfrom score_infogroup by stu_idhaving flag = 0) t1join student_info s on s.stu_id = t1.stu_id;
骚戴理解:这里是通过子查询加join来实现的,我一直以为这两个是不能一起用,然后主要理解下面的语句 ,首先这里是按stu_id分组,那么分组后可以看到每个学生的所有课程,然后这里的难点就是怎么判断每个课程都小于60分,这里用到了 sum(if(score >= 60, 1, 0)) ,这句是判断每门成绩是否大于60,如果大于那么返回1,小于则返回0,然后课程不止一门,这里要求每门,所以用sum去求和每门科目的返回值得和,只有每门课程的返回结果都是0,sum(if(score >= 60, 1, 0))的结果才是0,也就是flag才是0,flag为0就说明每门课程都没及格,所以最后通过 having flag = 0来获取都没有及格的
select stu_id,
sum(if(score >= 60, 1, 0)) flag
from score_info
group by stu_id
having flag = 0
结果
s.stu_id s.stu_name
008 吴京
017 范冰冰
*4.1.2查询没有学全所有课的学生的学号、姓名
解释:没有学全所有课,也就是该学生选修的课程数 < 总的课程数
hive>
select s.stu_id,s.stu_name
from student_info s
left join score_info sc on s.stu_id = sc.stu_id
group by s.stu_id, s.stu_name
having count(course_id) < (select count(course_id) from course_info);
结果
s.stu_id s.stu_name
001 彭于晏
002 胡歌
003 周杰伦
004 刘德华
006 陈道明
008 吴京
010 于谦
011 潘长江
012 杨紫
013 蒋欣
014 赵丽颖
015 刘亦菲
016 周冬雨
017 范冰冰
018 李冰冰
019 邓紫棋
020 宋丹丹
4.1.3 查询出只选修了三门课程的全部学生的学号和姓名
解释:学生选修的课程数 = 3
hive>
selects.stu_id,s.stu_name
from student_info s
join (selectstu_id,count(course_id) course_countfrom score_infogroup by stu_idhaving course_count =3) t1
on s.stu_id = t1.stu_id;骚戴解法
SELECT si.stu_id,si.stu_name
FROM (SELECT stu_id FROM score_infogroup by stu_id HAVING COUNT(course_id)=3
)t1
join student_info si on si.stu_id = t1.stu_id;
结果
s.stu_id s.stu_name
006 陈道明
008 吴京
011 潘长江
012 杨紫
019 邓紫棋
第五章多表查询
5.1 表联结
5.1.1 查询有两门及以上的课程不及格的同学的学号及其平均成绩
① 先找出有两门以上不及格的学生名单,按照学生分组,过滤组内成绩低于60的并进行count,count>=2。
② 接着做出一张表查询学生的平均成绩并和上一个子查询中的学生学号进行连接
hive>
selectt1.stu_id,t2.avg_score
from (selectstu_id,sum(if(score < 60,1,0)) flagefrom score_infogroup by stu_idhaving flage >= 2
) t1
join (selectstu_id,avg(score) avg_scorefrom score_infogroup by stu_id
) t2 on t1.stu_id = t2.stu_id;
骚戴理解:这里主要是学习这样的思想,把两个单独的select写出来然后再join在一起
结果
t1.stu_id t2.avg_score
007 59.8
008 43.0
010 58.25
013 61.0
014 48.0
015 70.25
017 45.25
018 58.0
019 59.333333333333336
020 69.75
5.1.2 查询所有学生的学号、姓名、选课数、总成绩
hive>
selects.stu_id,s.stu_name,count(sc.course_id) count_course,sum(sc.score) sum_score
from student_info s
left join score_info sc on s.stu_id = sc.stu_id
group by s.stu_id,s.stu_name;
骚戴理解:这里主要是注意分组是通过stu_id和stu_name来确定唯一的记录,很容易忘了对stu_name进行分组,还要注意group by的字段和select后面的字段要对应,例如下面的就是错的
![](https://img-blog.csdnimg.cn/img_convert/aa561600c9ad4ba0a8bb8ce5cf766d84.png)
骚戴理解:这里select后面红色画出的字段没有在group by中,所以会报错,如果select后面是聚合函数就没关系
selects.stu_id,s.stu_name,sc.course_id ,sc.score
from student_info s
left join score_info sc on s.stu_id = sc.stu_id;
为了更好的理解,这里先做一个左连接,看看下面的执行结果,然后会发现stu_id和stu_name两个一起分组才可以确定唯一的一个组
stu_id stu_name course_id score
003 周杰伦
017 范冰冰 01 58
017 范冰冰 04 34
017 范冰冰 03 55
017 范冰冰 02 34
005 唐国强 01 64
005 唐国强 05 85
005 唐国强 04 85
005 唐国强 03 99
005 唐国强 02 44
018 李冰冰 01 38
018 李冰冰 05 87
018 李冰冰 03 49
018 李冰冰 02 58
020 宋丹丹 01 89
020 宋丹丹 04 50
020 宋丹丹 03 81
020 宋丹丹 02 59
006 陈道明 01 71
006 陈道明 03 59
006 陈道明 02 90
015 刘亦菲 01 90
015 刘亦菲 05 59
015 刘亦菲 03 84
015 刘亦菲 02 48
019 邓紫棋 01 46
019 邓紫棋 03 93
019 邓紫棋 02 39
002 胡歌 01 74
002 胡歌 04 100
002 胡歌 03 87
002 胡歌 02 84
010 于谦 01 84
010 于谦 04 34
010 于谦 03 47
010 于谦 02 68
011 潘长江 01 61
011 潘长江 03 70
011 潘长江 02 49
009 郭德纲 01 75
009 郭德纲 05 79
009 郭德纲 04 79
009 郭德纲 03 60
009 郭德纲 02 78
001 彭于晏 01 94
001 彭于晏 04 54
001 彭于晏 03 79
001 彭于晏 02 63
004 刘德华 01 85
004 刘德华 04 59
004 刘德华 03 89
004 刘德华 02 93
013 蒋欣 01 47
013 蒋欣 04 69
013 蒋欣 03 93
013 蒋欣 02 35
014 赵丽颖 01 81
014 赵丽颖 04 40
014 赵丽颖 03 32
014 赵丽颖 02 39
007 陈坤 01 48
007 陈坤 05 63
007 陈坤 04 63
007 陈坤 03 70
007 陈坤 02 55
008 吴京 01 56
008 吴京 03 39
008 吴京 02 34
012 杨紫 01 44
012 杨紫 03 62
012 杨紫 02 74
016 周冬雨 01 71
016 周冬雨 04 94
016 周冬雨 03 71
016 周冬雨 02 89
结果
stu_id stu_name course_count course_sum
001 彭于晏 4 290
002 胡歌 4 345
003 周杰伦 0 0
004 刘德华 4 326
005 唐国强 5 377
006 陈道明 3 220
007 陈坤 5 299
008 吴京 3 129
009 郭德纲 5 371
010 于谦 4 233
011 潘长江 3 180
012 杨紫 3 180
013 蒋欣 4 244
014 赵丽颖 4 192
015 刘亦菲 4 281
016 周冬雨 4 325
017 范冰冰 4 181
018 李冰冰 4 232
019 邓紫棋 3 178
020 宋丹丹 4 279
5.1.3 查询平均成绩大于85的所有学生的学号、姓名和平均成绩
hive>
select s.stu_id,s.stu_name,avg(sc.score) avg_score
from score_info sc
left join student_info s on s.stu_id = sc.stu_id
group by s.stu_id, s.stu_name
having avg_score > 85
结果
stu_id stu_name avg_score
002 胡歌 86.25
5.1.4 查询学生的选课情况:学号,姓名,课程号,课程名称
hive>
selects.stu_id,s.stu_name,c.course_id,c.course_name
from score_info sc
join course_info c on sc.course_id = c.course_id
join student_info s on sc.stu_id = s.stu_id;
骚戴理解:这里要通过score_info表来做媒介牵绳把course_info和student_info连一起
结果
s.stu_id s.stu_name c.course_id c.course_name 017范冰冰03英语 017范冰冰04体育 005唐国强03英语 018李冰冰03英语 020宋丹丹03英语 005唐国强04体育 020宋丹丹04体育 006陈道明03英语 015刘亦菲03英语 019邓紫棋03英语 002胡歌03英语 002胡歌04体育 010于谦03英语 011潘长江03英语 010于谦04体育 009郭德纲03英语 009郭德纲04体育 001彭于晏03英语 004刘德华03英语 013蒋欣03英语 001彭于晏04体育 004刘德华04体育 013蒋欣04体育 014赵丽颖03英语 014赵丽颖04体育 007陈坤03英语 008吴京03英语 012杨紫03英语 016周冬雨03英语 007陈坤04体育 016周冬雨04体育 017范冰冰02数学 005唐国强02数学 018李冰冰02数学 020宋丹丹02数学 005唐国强05音乐 018李冰冰05音乐 006陈道明02数学 015刘亦菲02数学 019邓紫棋02数学 015刘亦菲05音乐 002胡歌02数学 010于谦02数学 011潘长江02数学 009郭德纲02数学 009郭德纲05音乐 001彭于晏02数学 004刘德华02数学 013蒋欣02数学 014赵丽颖02数学 007陈坤02数学 008吴京02数学 012杨紫02数学 016周冬雨02数学 007陈坤05音乐 017范冰冰01语文 | s.stu_id s.stu_name c.course_id c.course_name 005唐国强01语文 018李冰冰01语文 020宋丹丹01语文 006陈道明01语文 015刘亦菲01语文 019邓紫棋01语文 002胡歌01语文 010于谦01语文 011潘长江01语文 009郭德纲01语文 001彭于晏01语文 004刘德华01语文 013蒋欣01语文 014赵丽颖01语文 007陈坤01语文 008吴京01语文 012杨紫01语文 016周冬雨01语文 002 胡歌 03 英语 001 彭于晏 03 英语 004 刘德华 03 英语 005 唐国强 03 英语 006 陈道明 03 英语 007 陈坤 03 英语 008 吴京 03 英语 009 郭德纲 03 英语 010 于谦 03 英语 011 潘长江 03 英语 012 杨紫 03 英语 013 蒋欣 03 英语 014 赵丽颖 03 英语 015 刘亦菲 03 英语 016 周冬雨 03 英语 017 范冰冰 03 英语 018 李冰冰 03 英语 019 邓紫棋 03 英语 020 宋丹丹 03 英语 001 彭于晏 04 体育 002 胡歌 04 体育 004 刘德华 04 体育 005 唐国强 04 体育 007 陈坤 04 体育 009 郭德纲 04 体育 010 于谦 04 体育 013 蒋欣 04 体育 014 赵丽颖 04 体育 016 周冬雨 04 体育 017 范冰冰 04 体育 020 宋丹丹 04 体育 005 唐国强 05 音乐 007 陈坤 05 音乐 009 郭德纲 05 音乐 015 刘亦菲 05 音乐 018 李冰冰 05 音乐 |
5.1.5 查询出每门课程的及格人数和不及格人数
hive>
selectc.course_id,c.course_name,t1.`及格人数`,t1.`不及格人数`
from course_info c
join (selectcourse_id,sum(if(score >= 60,1,0)) as `及格人数`,sum(if(score < 60,1,0)) as `不及格人数`from score_infogroup by course_id) t1 on c.course_id = t1.course_id;
骚戴理解:这里注意`及格人数`的符号问题,是 ` 不是单引号‘
结果
c.course_id c.course_name t1.及格人数 t1.不及格人数
01 语文 12 7
02 数学 8 11
03 英语 13 6
04 体育 6 6
05 音乐 4 1
5.1.6 查询课程编号为03且课程成绩在80分以上的学生的学号和姓名及课程信息
hive>
selects.stu_id,s.stu_name,t1.score,t1.course_id,c.course_name
from student_info s
join (selectstu_id,score,course_idfrom score_infowhere score > 80 and course_id = '03') t1
on s.stu_id = t1.stu_id
join course_info c on c.course_id = t1.course_id;骚戴解法
select si2.stu_id ,si2.stu_name,si.score,si.course_id ,ci.course_name
from score_info si
join student_info si2 on si.stu_id = si2.stu_id
join course_info ci on si.course_id = ci.course_id
where ci.course_id ='03' and si.score >=80;
结果
s.stu_id s.stu_name t1.score t1.course_id c.course_name
002 胡歌 87 03 英语
004 刘德华 89 03 英语
005 唐国强 99 03 英语
013 蒋欣 93 03 英语
015 刘亦菲 84 03 英语
019 邓紫棋 93 03 英语
020 宋丹丹 81 03 英语
5.2 多表连接
5.2.1 课程编号为"01"且课程分数小于60,按分数降序排列的学生信息
hive>
selects.stu_id,s.stu_name,s.birthday,s.sex,t1.score
from student_info s
join (selectstu_id,course_id,scorefrom score_infowhere score < 60 and course_id = '01') t1
on s.stu_id=t1.stu_id
order by t1.score desc;骚戴解法
select si2.stu_id ,si2.stu_name,si2.birthday,si2.sex,si.score
from score_info si
join student_info si2 on si.stu_id = si2.stu_id
join course_info ci on si.course_id = ci.course_id
where ci.course_id ='01' and si.score <60
order by si.score desc;
结果
s.stu_id s.stu_name s.birthday s.sex t1.score
017 范冰冰 1992-07-04 女 58
008 吴京 1994-02-06 男 56
007 陈坤 1999-04-09 男 48
013 蒋欣 1997-11-08 女 47
019 邓紫棋 1994-08-31 女 46
012 杨紫 1996-12-21 女 44
018 李冰冰 1993-09-24 女 38
5.2.2 查询所有课程成绩在70分以上的学生的姓名、课程名称和分数,按分数升序排列
hive>
selects.stu_id,s.stu_name,c.course_name,s2.score
from student_info s
join (selectstu_id,sum(if(score >= 70,0,1)) flagefrom score_infogroup by stu_idhaving flage =0) t1
on s.stu_id = t1.stu_id
left join score_info s2 on s.stu_id = s2.stu_id
left join course_info c on s2.course_id = c.course_id;
骚戴理解:这里要有清晰的思路,首先通过子查询把所有课程都70分的学生id查出来,然后和student_info进行join,然后在和score_info进行left join,最后和course_info进行left join。注意顺序不能错!(因为子查询和student_info进行join的结果表只能先和score_info拼接),这里注意left join score_info s2 on s.stu_id = s2.stu_id语句的左边的驱动表是子查询和student_info进行join的结果表,然后我之前没有很好的理解多表联查的on后面的条件拼接,我以为在left join course_info c on s2.course_id = c.course_id;这里的on后面必须是student_info和course_info进行拼接,然而这两个表没发拼接!所以只要是join后的结果表和其他的表继续join,那么就可以使用join过的表的字段进行拼接,例如这里的left join course_info c on s2.course_id = c.course_id;语句的左边驱动表就是子查询和student_info进行join的结果表再和score_info进行left join的结果表,也就是能够和course_info进行join的on后面拼接的条件中可以使用之前的三个表的字段来连接,这里用的就是score_info和course_info拼接,拼接条件是 s2.course_id = c.course_id
结果
s.stu_id s.stu_name c.course_name s2.course
002 胡歌 语文 74
002 胡歌 数学 84
002 胡歌 英语 87
002 胡歌 体育 100
016 周冬雨 语文 71
016 周冬雨 数学 89
016 周冬雨 英语 71
016 周冬雨 体育 94
5.2.3 查询该学生不同课程的成绩相同的学生编号、课程编号、学生成绩
hive>
selectsc1.stu_id,sc1.course_id,sc1.score
from score_info sc1
join score_info sc2 on sc1.stu_id = sc2.stu_id
where sc1.course_id <> sc2.course_id
and sc1.score = sc2.score;
骚戴理解:这里用的是同一个表自己和自己join,理解一下这个自己join自己的场景
结果
sc1.stu_id sc1.course_id sc1.score
016 03 71
017 04 34
016 01 71
005 05 85
007 05 63
009 05 79
017 02 34
005 04 85
007 04 63
009 04 79
5.2.4 查询课程编号为“01”的课程比“02”的课程成绩高的所有学生的学号
知识点:多表连接 + 条件
hive>
selects1.stu_id
from
(selectsc1.stu_id,sc1.course_id,sc1.scorefrom score_info sc1where sc1.course_id ='01'
) s1
join
(selectsc2.stu_id,sc2.course_id,scorefrom score_info sc2where sc2.course_id ="02"
)s2
on s1.stu_id=s2.stu_id
where s1.score > s2.score;
结果
stu_id
001
005
008
010
011
013
014
015
017
019
020
5.2.5 查询学过编号为“01”的课程并且也学过编号为“02”的课程的学生的学号、姓名
hive>
selectt1.stu_id as `学号`,s.stu_name as `姓名`
from
(selectstu_idfrom score_info sc1where sc1.course_id='01'and stu_id in (selectstu_idfrom score_info sc2where sc2.course_id='02')
)t1
join student_info s
on t1.stu_id = s.stu_id;
骚戴理解:这里用的where...in....来处理学过编号为“01”的课程并且也学过编号为“02”的课程这个条件筛选
结果
学号 姓名
001 彭于晏
002 胡歌
004 刘德华
005 唐国强
006 陈道明
007 陈坤
008 吴京
009 郭德纲
010 于谦
011 潘长江
012 杨紫
013 蒋欣
014 赵丽颖
015 刘亦菲
016 周冬雨
017 范冰冰
018 李冰冰
019 邓紫棋
020 宋丹丹
5.2.6 查询学过“李体音”老师所教的所有课的同学的学号、姓名
hive>
selectt1.stu_id,si.stu_name
from
(selectstu_idfrom score_info siwhere course_id in(selectcourse_idfrom course_info cjoin teacher_info ton c.tea_id = t.tea_idwhere tea_name='李体音' --李体音教的所有课程)group by stu_idhaving count(*)=2 --学习所有课程的学生
)t1
left join student_info si
on t1.stu_id=si.stu_id;骚戴解法
select si.stu_id ,si.stu_name
from (
select stu_id
from score_info
where course_id in (select course_id from course_info where tea_id in(select tea_id from teacher_infowhere tea_name = '李体音'))group by stu_idhaving count(*)=2
)t
join student_info si on si.stu_id = t.stu_id;
结果
s.stu_id s.stu_name
005 唐国强
007 陈坤
009 郭德纲
5.2.7查询学过“李体音”老师所讲授的任意一门课程的学生的学号、姓名
hive>
selectt1.stu_id,si.stu_name
from
(selectstu_idfrom score_info siwhere course_id in(selectcourse_idfrom course_info cjoin teacher_info ton c.tea_id = t.tea_idwhere tea_name='李体音')
)t1
left join student_info si
on t1.stu_id=si.stu_id;骚戴解法
SELECT si.stu_id ,si.stu_name
FROM (
SELECT stu_id
FROM score_info
WHERE course_id in (SELECT course_id FROM course_info WHERE tea_id in(SELECT tea_id FROM teacher_infoWHERE tea_name = '李体音'))
)t
join student_info si on si.stu_id = t.stu_id;
结果
s.stu_id s.stu_name
001 彭于晏
002 胡歌
004 刘德华
005 唐国强
007 陈坤
009 郭德纲
010 于谦
013 蒋欣
014 赵丽颖
015 刘亦菲
016 周冬雨
017 范冰冰
018 李冰冰
020 宋丹丹
5.2.8 查询没学过"李体音"老师讲授的任一门课程的学生姓名
hive>
selectstu_id,stu_name
from student_info
where stu_id not in
(selectstu_idfrom score_info siwhere course_id in(selectcourse_idfrom course_info cjoin teacher_info ton c.tea_id = t.tea_idwhere tea_name='李体音')group by stu_id
);
结果
stu_id stu_name
003 周杰伦
006 陈道明
008 吴京
011 潘长江
012 杨紫
019 邓紫棋
5.2.9查询至少有一门课与学号为“001”的学生所学课程相同的学生的学号和姓名
hive>
selectsi.stu_id,si.stu_name
from score_info sc
join student_info si
on sc.stu_id = si.stu_id
where sc.course_id in
(selectcourse_idfrom score_infowhere stu_id='001' --001的课程
) and sc.stu_id <> '001' --排除001学生
group by si.stu_id,si.stu_name;骚戴理解
select stu_id ,stu_name
from student_info
where stu_id not in (select stu_id from score_info where course_id not in (select course_id from score_info where stu_id = '001')
);
结果
s1.stu_id s2.stu_name
002 胡歌
004 刘德华
005 唐国强
006 陈道明
007 陈坤
008 吴京
009 郭德纲
010 于谦
011 潘长江
012 杨紫
013 蒋欣
014 赵丽颖
015 刘亦菲
016 周冬雨
017 范冰冰
018 李冰冰
019 邓紫棋
020 宋丹丹
5.2.10 按平均成绩从高到低显示所有学生的所有课程的成绩以及平均成绩
hive>
selectsi.stu_name,ci.course_name,sc.score,t1.avg_score
from score_info sc
join student_info si
on sc.stu_id=si.stu_id
join course_info ci
on sc.course_id=ci.course_id
join
(selectstu_id,avg(score) avg_scorefrom score_infogroup by stu_id
)t1
on sc.stu_id=t1.stu_id
order by t1.avg_score desc;
结果
t2.stu_name t2.course_name t2.score t1.avg_score
胡歌 体育 100 86.25
胡歌 数学 84 86.25
胡歌 英语 87 86.25
胡歌 语文 74 86.25
刘德华 体育 59 81.5
刘德华 语文 85 81.5
刘德华 英语 89 81.5
刘德华 数学 93 81.5
周冬雨 英语 71 81.25
周冬雨 数学 89 81.25
周冬雨 体育 94 81.25
周冬雨 语文 71 81.25
唐国强 数学 44 75.4
唐国强 音乐 85 75.4
唐国强 语文 64 75.4
唐国强 体育 85 75.4
唐国强 英语 99 75.4
郭德纲 音乐 79 74.2
郭德纲 体育 79 74.2
郭德纲 英语 60 74.2
郭德纲 语文 75 74.2
郭德纲 数学 78 74.2
陈道明 语文 71 73.33333333333333
陈道明 数学 90 73.33333333333333
陈道明 英语 59 73.33333333333333
……
李冰冰 音乐 87 58.0
李冰冰 语文 38 58.0
李冰冰 英语 49 58.0
李冰冰 数学 58 58.0
赵丽颖 数学 39 48.0
赵丽颖 语文 81 48.0
赵丽颖 体育 40 48.0
赵丽颖 英语 32 48.0
范冰冰 英语 55 45.25
范冰冰 体育 34 45.25
范冰冰 数学 34 45.25
范冰冰 语文 58 45.25
吴京 语文 56 43.0
吴京 数学 34 43.0
吴京 英语 39 43.0
相关文章:
![](https://img-blog.csdnimg.cn/img_convert/aa561600c9ad4ba0a8bb8ce5cf766d84.png)
大数据技术之Hive SQL题库-初级
第一章环境准备1.1 建表语句hive>-- 创建学生表 DROP TABLE IF EXISTS student; create table if not exists student_info(stu_id string COMMENT 学生id,stu_name string COMMENT 学生姓名,birthday string COMMENT 出生日期,sex string COMMENT 性别 ) row format delim…...
![](https://www.ngui.cc/images/no-images.jpg)
常见HTTP状态码汇总
文章目录1xx: 信息2xx: 成功3xx: 重定向4xx: 客户端错误5xx: 服务器错误1xx: 信息 状态码描述100 Continue服务器仅接收到部分请求,但是一旦服务器并没有拒绝该请求,客户端应该继续发送其余的请求。101 Switching Protocols服务器转换协议:服…...
![](https://img-blog.csdnimg.cn/f8b284a4e903400a9f74036e9221054b.jpeg#pic_center)
蓝桥杯刷题冲刺 | 倒计时15天
作者:指针不指南吗 专栏:蓝桥杯倒计时冲刺 🐾马上就要蓝桥杯了,最后的这几天尤为重要,不可懈怠哦🐾 文章目录1.年号字串2.裁纸刀3.猜生日1.年号字串 题目 链接: 年号字串 - 蓝桥云课 (lanqiao.c…...
![](https://img-blog.csdnimg.cn/3d0ac53c43d14721826a4ccadcb2f460.png)
【差分数组】
差分数组一维差分差分数组的作用差分矩阵结语一维差分 输入一个长度为 n 的整数序列。接下来输入 m个操作,每个操作包含三个整数 l,r,c,表示将序列中 [l,r] 之间的每个数加上 c ,请你输出进行完所有操作后的序列。 输入格式 第一行包含两个…...
![](https://img-blog.csdnimg.cn/d40c3394f9e54336a6de1ee30e771176.png)
2022年NOC软件创意编程(学而思)决赛小学高年级组scratch
2022NOC决赛图形化小高组 一、选择题 1.运行下面的程序,最终“我的变量”的值是多少? 2.希望定义一个函数如下,可以让角色旋转指定的圈数。里面空缺的地方填上什么数字比较合适? 3.运行程序,在舞台上可以看见几个角色 ? 4.运行程序,角色会依次说什么 ? 5.我们都知…...
![](https://img-blog.csdnimg.cn/36749ff38eba4343ace800a6f10f0049.png)
[JAVA]一步接一步的一起开发-图书管理系统(非常仔细,你一定能看懂)[1W字+]
目录 1.想法 2.框架的搭构 2.1图书 2.1.1Book类 2.1.2BookList类 2.2用户 2.2.1User抽象类 2.2.2AdminUser类(管理者) 2.2.3NormalUser 2.3操作 操作接口 借阅操作 删除操作 查询操作 归还图书 展示图书 退出系统 2.4小结 3.主函数的编…...
![](https://img-blog.csdnimg.cn/c3ca523dbcbc4f0088ddee528e91c7fb.jpeg)
大数据周会-本周学习内容总结07
目录 01【hadoop】 1.1【编写集群分发脚本xsync】 1.2【集群部署规划】 1.3【Hadoop集群启停脚本】 02【HDFS】 2.1【HDFS的API操作】 03【MapReduce】 3.1【P077- WordCount案例】 3.2【P097-自定义分区案例】 历史总结 01【hadoop】 1.1【编写集群分发脚本xsync】…...
![](https://img-blog.csdnimg.cn/b87d4af1470449cfbf85708edec2a46c.png#pic_center)
搭建一个双系统个人服务器
搭建一个双系统个人服务器0.前言一、双系统安装1.磁盘划分2.windows安装3.ubuntu安装二、系统启动项美化:1. refind引导2. 美化 grub 界面三、系统代理0.前言 年后找了份工作,忙于适应新环境所以更新也减缓了,最近闲暇时间给个人电脑进行了整…...
![](https://img-blog.csdnimg.cn/img_convert/edc2ae47e76d8fe0bea62a355d2af157.jpeg)
电脑长按电源键强行关机,对SSD有伤害吗?SSD 掉盘之殇
说到“按住电源键强制关机”的操作,想必大家都不会陌生,毕竟在电脑蓝屏或者电脑死机的时候,我们总是束手无策。而且,身边的人在遇到同样的情况时,往往都是选择长按电源键强制关机,所以当我们遇到同样的情况…...
![](https://www.ngui.cc/images/no-images.jpg)
Linux:centos内核优化详解
一、系统内核部分设置在以下文件 vim /etc/sysctl.conf 1.禁用IPV6 net.ipv6.conf.all.disable_ipv6 1 # 禁用整个系统所有接口的IPv6 net.ipv6.conf.default.disable_ipv6 1 net.ipv6.conf.lo.disable_ipv6 1 # 禁用某一个指定接口的IPv6(此处为:lo) 理想情况下,…...
![](https://img-blog.csdnimg.cn/9077a2fe205b48f5867e9907cc23a625.jpeg)
链表经典OJ题合集(包含带环问题,相交问题,随机指针复制等,附动画讲解)
目录 一:前言 二:简单题目 (1)移除链表元素 (2)反转链表 (3)找链表的中间结点 (4)输入一个链表,输出该链表中倒数第k个结点 (5)合并两个有序链表 (6)相交链表 (7)判断链表是否带环 三:较难题目 (1)链表分割 (2)判断链表是否为回…...
![](https://www.ngui.cc/images/no-images.jpg)
CSS新增
系列文章目录 前端系列文章——传送门 CSS系列文章——传送门 文章目录系列文章目录什么是 CSS3渐进增强和优雅降级CSS3 中的选择器CSS3 中的背景CSS3 中的边框CSS3 中的文本效果CSS3 中的字体 font-face什么是 CSS3 CSS3是CSS(层叠样式表)技术的升级版…...
![](https://img-blog.csdnimg.cn/7490b15ca08845baa13c020daaa05356.png)
奇安信_防火墙部署_透明桥模式
奇安信_防火墙部署_透明桥模式一、预备知识二、项目场景三、拓扑图四、基本部署配置1. 登录web控制台2.连通性配置3.可信主机配置4.授权导入5.特征库升级6.安全配置文件五、透明桥配置1. 创建桥2. 端口绑定桥3. 创建桥端口六、结语一、预备知识 安全设备接入网络部署方式 二、…...
![](https://img-blog.csdnimg.cn/img_convert/07fb74f4b7355119ef45a6bca1094339.png)
C语言——字符串函数(2)和内存函数
(一)strtok函数dilimiters参数是个字符串,定义了用作分隔符的字符集合第一个参数指定一个字符串,它包含了0个或者多个由dilimiters字符串中一个或者多个分隔符分割的标记。strtok函数找到str中的下一个标记,并将其用 \0 结尾,返回…...
![](https://www.ngui.cc/images/no-images.jpg)
第1节 线性回归模型
1. 模型概述 对于收集到的数据(xi,yi)(x_i,y_i)(xi,yi),建立线性回归模型yiθTxiεi(1)y_i\theta^{^T} x_i \varepsilon_i (1)yiθTxiεi(1) 需要估计的参数为θT\theta^{^T}θT,我们的目的是让估计的参数θT\theta^{^T}θT和xix_ixi…...
![](https://img-blog.csdnimg.cn/b0e46c4c10a745cf83bc069e85e0185c.png)
CodeGeeX 130亿参数大模型的调优笔记:比FasterTransformer更快的解决方案
0x0 背景 相信大家都使用或者听说过github copilot这个高效的代码生成工具。CodeGeeX类似于github copilot,是由清华大学,北京智源研究院,智谱AI等机构共同开发的一个拥有130亿参数的多编程语言代码生成预训练模型。它在vscode上也提供了插件…...
![](https://www.ngui.cc/images/no-images.jpg)
Linux驱动之并发与竞争
文章目录并发与竞争的概念原子操作原子整形操作 API 函数原子位操作 API 函数自旋锁自旋锁简介自旋锁结构体自旋锁 API 函数自旋锁的注意事项读写自旋锁读写自旋锁的API顺序锁顺序锁的APIRCU(Read-Copy-Update)RCU的API信号量信号量API互斥体互斥体的API完成量(Completion)完成…...
![](https://img-blog.csdnimg.cn/img_convert/d4cd857d5cdf43dc94fb729097178160.png)
【密码学复习】第四讲分组密码(三)
AES算法的整体结构 AES算法的轮函数 1)字节代换(SubByte) 2)行移位(ShiftRow) 3)列混合(MixColumn) 4)密钥加(AddRoundKey)1-字节代换…...
![](https://img-blog.csdnimg.cn/img_convert/6ef37deaaa07acd3c3eb018b903f8c51.png)
JVM(内存划分,类加载,垃圾回收)
JVMJava程序,是一个名字为Java 的进程,这个进程就是所说的“JVM”1.内存区域划分JVM会先从操作系统这里申请一块内存空间,在这个基础上再把这个内存空间划分为几个小的区域在一个JVM进程中,堆和方法区只有一份;栈和程序…...
![](https://www.ngui.cc/images/no-images.jpg)
工作中遇到的问题 -- 你见过哪些写的特别好的代码
strPtr : uintptr((*(*stringStruct)(unsafe.Pointer(&str))).str)代码解析: 这是一段 Go 代码,它的作用是获取一个字符串变量 str 的底层指针,即字符串数据的起始地址。 这段代码涉及到了 Go 语言中的指针、类型转换和内存布局等概念&…...
![](https://www.ngui.cc/images/no-images.jpg)
基于chatGPT设计卷积神经网络
1. 简介 本文主要介绍基于chatGPT,设计一个针对骁龙855芯片设计的友好型神经网络。 提问->跑通总共花了5min左右,最终得到的网络在Cifar100数据集上与ResNet18的精度对比如下。 模型flopsparamstrain acc1/5test acc1/5ResNet18(timm)1.8211.18~98…...
![](https://www.ngui.cc/images/no-images.jpg)
java.sql.Date和java.util.Date的区别
参考答案 java.sql.Date 是 java.util.Date 的子类java.util.Date 是 JDK 中的日期类,精确到时、分、秒、毫秒java.sql.Date 与数据库 Date 相对应的一个类型,只有日期部分,时分秒都会设置为 0,如:2019-10-23 00:00:0…...
![](https://img-blog.csdnimg.cn/2b182def443e42f589e5fdb7d9fe91d2.png)
动态规划---线性dp和区间dp
动态规划(三) 目录动态规划(三)一:线性DP1.数字三角形1.1数字三角形题目1.2代码思路1.3代码实现(正序and倒序)2.最长上升子序列2.1最长上升子序列题目2.2代码思路2.3代码实现3.最长公共子序列3.1最长公共子序列题目3.2代码思路3.3代码实现4.石子合并4.1题目如下4.2代…...
![](https://www.ngui.cc/images/no-images.jpg)
常见的2D与3D碰撞检测算法
分离轴分离轴定理(Separating Axis Theorem)是用于解决2D或3D物体碰撞检测问题的一种方法。其基本思想是,如果两个物体未发生碰撞,那么可以找到一条分离轴(即一条直线或平面),两个物体在该轴上的…...
![](https://img-blog.csdnimg.cn/30da460621a241a88768b0a48393b815.png)
STM32 10个工程篇:1.IAP远程升级(二)
一直提醒自己要更新CSDN博客,但是确实这段时间到了一个项目的关键节点,杂七杂八的事情突然就一涌而至。STM32、FPGA下位机代码和对应Labview的IAP升级助手、波形设置助手上位机代码笔者已经调试通过,因为不想去水博客、凑数量,复制…...
![](https://img-blog.csdnimg.cn/img_convert/d875dec64ee8c8604bb3d80b64f98ff1.gif)
Unity+ChatGpt的联动 AICommand
果然爱是会消失的,对吗 chatGpt没出现之前起码还看人家的文章,现在都是随便你。 本着师夷长技以制夷的思路,既然打不过,那么我就加入 github地址:https://github.com/keijiro/AICommand 文档用chatGpt翻译如下&#…...
![](https://img-blog.csdnimg.cn/abaf0518005948df8a92bfb17cb2c018.png)
STM-32:按键控制LED灯 程序详解
目录一、基本原理二、接线图三、程序思路3.1库函数3.2程序代码注:一、基本原理 左边是STM322里电路每一个端口均可以配置的电路部分,右边部分是外接设备 电路图。 配置为 上拉输入模式的意思就是,VDD开关闭合,VSS开关断开。 浮空…...
![](https://img-blog.csdnimg.cn/92112786c73e45d8af8b1437e892a253.png)
北邮22信通:(8)实验1 题目五:大整数加减法(搬运官方代码)
北邮22信通一枚~ 跟随课程进度每周更新数据结构与算法的代码和文章 持续关注作者 解锁更多邮苑信通专属代码~ 上一篇文章: 北邮22信通:(7)实验1 题目四:一元多项式(节省内存版)_青山如…...
![](https://img-blog.csdnimg.cn/fac3a3cfcf1443c9ad17b96debff928b.png?)
Fiddler抓取https史上最强教程
有任何疑问建议观看下面视频 2023最新Fiddler抓包工具实战,2小时精通十年技术!!!对于想抓取HTTPS的测试初学者来说,常用的工具就是fiddler。 但是初学时,大家对于fiddler如何抓取HTTPS难免走歪路ÿ…...
![](https://img-blog.csdnimg.cn/6cf1c33012b04068b547b34dda4ac088.png)
STM32开发基础知识入门
C语言基础 位操作 对基本类型变量可以在位级别进行操作。 1) 不改变其他位的值的状况下,对某几个位进行设值。 先对需要设置的位用&操作符进行清零操作,然后用|操作符设值。 2) 移位操作提高代码的可读性。 3) ~取反操作使用技巧 可用于对某…...
![](/images/no-images.jpg)
可以做外国网站文章/电销系统软件排名
计算某个范围之内的所有质数/* --功能:计算某个范围之内的所有质数 --作者: --日期:20180927 --语言:t-sql for sql server 2012 sp4 */ DECLARE n INT 10000; --计算自然数的最大值 DECLARE d INT 2;--除数,检验n能够…...
![](/images/no-images.jpg)
在哪里可以学做网站/100个电商平台
Matplotlib ——(分解) Matrix Plot Library 矩阵 绘图 库 一个极其强大的Python绘图库。官网:matplotlib.org 很少的代码即可绘制2D/3D,静态/动态等各种图形 一般常用的是它的子包:PyPlot,提…...
![](/images/no-images.jpg)
wordpress菜单栏设置/百度电脑版下载
IntelliJ IDEA 设置代码提示或自动补全的快捷键 (附IntelliJ IDEA常用快捷键) 转载博客园:https://www.cnblogs.com/jx17/p/6244491.html 修改方法如下: 点击 文件菜单(File) –> 点击 设置(Settings… CtrlAltS), –> 打开设置对话框。 在左侧…...
![](/images/no-images.jpg)
北京网站设计十年乐云seo/seo搜索引擎优化平台
题目链接 题意: 有M个机器,N个任务 对第i个任务,需要在[Si,Ei]这段时间内恰有Pi天被process 每天最多有M个机器同时工作 每一天,一个任务若被process,那么它恰占用一个机器。 题解:建图,设一个超…...
![](https://img-blog.csdnimg.cn/img_convert/5ea96fb42ec86f35a652cf3f6df47db2.png)
114网站做推广怎么样/百度seo白皮书
第三方验收测试 第三方验收测试-验收测试服务-UAT测试-网站测试报告-Alltesting泽众云测试www.alltesting.cn/jsp/newVersion2/bigNews/testService/check-test.jsp 第三方验收测试是公正、客观地评估系统功能、性能、安全等质量特性与需求规格说明书是否一致的过程࿰…...
![](https://img-blog.csdnimg.cn/66a33d4f61884d37bca86e2a14c4e44b.png?x-oss-process=image/watermark,type_d3F5LXplbmhlaQ,shadow_50,text_Q1NETiBA5Yqq5Yqb5omR6IW-55qE5bCP6I-c6bif,size_20,color_FFFFFF,t_70,g_se,x_16#pic_center)
网站开发中网页之间的连接形式/网络做推广公司
使用ansible中的playbookPlaybook的功能YAML简介特点语法简介Playbook的核心组件vim 设定技巧playbook执行命令练习Playbook的功能 playbook 是由一个或多个play组成的列表 playbook文件使用YAML来写的 YAML 简介 是一种表达资料序列的格式,类似XML Yet Another…...