zoukankan      html  css  js  c++  java
  • Oracle查询作业1-11题

    1、 查询Student表中的所有记录的Sname、Ssex和Class列。

    select sname,ssex,class from STUDENT t

    2、 查询教师所有的单位即不重复的Depart列。

    select distinct depart from TEACHER t

    3、 查询Student表的所有记录。

    select * from STUDENT t

    4、 查询Score表中成绩在60到80之间的所有记录。

    select * from SCORE t where degree >60 and degree <80

    5、 查询Score表中成绩为85,86或88的记录。

    select * from SCORE t where degree=85 or degree=86 or degree=88

    6、 查询Student表中“95031”班或性别为“女”的同学记录。

    select * from STUDENT t where class=95031 or ssex=''

    7、 以Class降序查询Student表的所有记录。

    select * from STUDENT t order by class desc

    8、 以Cno升序、Degree降序查询Score表的所有记录。

    select * from SCORE t order by cno  asc,degree desc

    9、 查询“95031”班的学生人数。

    select count(*) from STUDENT t where class=95031

    10、 查询Score表中的最高分的学生学号和课程号。(子查询或者排序)

    select sno,cno from SCORE t where degree=(select max(degree)from score t)

    11、 查询每门课的平均成绩。

    select cno,avg(degree) from SCORE t group by cno

  • 相关阅读:
    Socket网络编程--简单Web服务器(4)
    GCC学习笔记
    字符分隔符'1'(u0001)的困惑
    g++编译时遇到问题undefined reference to
    ROS学习笔记(三)
    cJSON笔记
    ROS学习笔记(二)
    ROS学习笔记(一)
    ffmpeg推流方式采用TCP协议
    Android OS的image文件组成
  • 原文地址:https://www.cnblogs.com/miss123/p/5577935.html
Copyright © 2011-2022 走看看