Hive sql 初级题 04

发布时间:2026/6/25 13:41:07
Hive sql 初级题 04 数据在Hive sql 初级题 01查询所有课程成绩均小于60分的学生的学号、姓名select s.stu_id, s.stu_name from ( select stu_id, sum(if(score 60, 1, 0)) flag from score_info group by stu_id having flag 0 ) t1 join student_info s on s.stu_id t1.stu_id;查询没有学全所有课的学生的学号、姓名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);查询出只选修了三门课程的全部学生的学号和姓名select student_info.stu_id, stu_name from(select stu_id from score_info group by stu_id having count(course_id)3)t1 join student_info on student_info.stu_idt1.stu_id