zoukankan      html  css  js  c++  java
  • oracle练习20-23

    20.查询score中选学多门课程的同学中分数为非最高分成绩的记录。

    select * from score s where degree <(select max(degree) from score ) 
    and cno in(select cno from score group by cno having count(cno)>1)

    21、查询成绩高于学号为“109”、课程号为“3-105”的成绩的所有记录。

    Select * from score t where cno='3-105'
    and degree>(select degree from score t where cno='3-105'and sno='109')

    22、查询和学号为108的同学同年出生的所有学生的Sno、Sname和Sbirthday列。

    select sno,sname,sbirthday from student t where to_char(sbirthday,'yy')=(select to_char(sbirthday,'yy')from student t where sno='108')

    23、查询“张旭“教师任课的学生成绩。

    select s.sno,s.degree from score s,course c,teacher t 
    where t.tno=c.tno and s.cno=c.cno and t.tname='张旭'

  • 相关阅读:
    IDEA
    SpringCloud
    Docker
    Docker
    JDK排序
    选择排序
    冒泡排序
    计算一个整数数组的平均数
    (if语句)中国的个税计算方法
    读入一个表示年份的整数,判断这一年是否是闰年
  • 原文地址:https://www.cnblogs.com/miss123/p/5592825.html
Copyright © 2011-2022 走看看