Oracle_SQL基础考核题目

本文提供了Oracle SQL的基础考核题目,包括查询未上过刘阳老师课的学生信息、课程成绩对比、按及格率排序的成绩、统计分数段人数、查找各科成绩前三名等12道题目,覆盖了数据查询和分析的多个方面。
摘要由CSDN通过智能技术生成

一、查询没学过“刘阳”老师课的同学,显示(学号、姓名)(5分)

select s.student_no , s.student_name from hand_student s 
left join hand_student_core sc on s.student_no=sc.student_no
left join hand_course c on sc.course_no=c.course_no
left join hand_teacher t on c.teacher_no=t.teacher_no
where t.teacher_name!='刘阳';

二、查询“c001”课程比“c002”课程成绩高的所有学生,显示(学号、姓名)(5分)

  • 方法一:
select s.student_no, s.student_name
  from hand_student s,
       (
       select hsc.*,
               rank() over(partition by student_no order by core) as rank
          from hand_student_core hsc
         where hsc.course_no = 'c001'
            or hsc.course_no = 'c002'
            ) temp
 where 1 = 1
 and s.student_no = temp.student_no
 and temp.course_no = 'c001'
 and temp.rank <> 1
  • 方法二:
select s.student_no,s.student_name from hand_student s,
hand_student_core sc1,hand_student_core sc2 
where s.student_no = 
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值