zoukankan      html  css  js  c++  java
  • select练习1

    1、 查询Student表中的所有记录的SnameSsexClass列。

    select t.sname ,t.ssex , t.sclass from student t

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

    select distinct depart from teacher

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

    select * from student;

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

    select s.* from score s where s.degree>=60 and s.degree<=80;

    select s.* from score s where s.degree between 60 and 80;

    5、 查询Score表中成绩为858688的记录。

    select s.* from score s where s.degree=85 or s.degree=86 or s.degree=88;

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

    select t.* from student t where t.sclass=95031 or t.ssex='女';

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

    select * from student order by sno;

    select * from student order by sno desc;

    select * from student order by sclass desc;

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

    select * from score order by cno, degree desc;

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

    select count(1) from student where sclass='95031';

    10、 查询Score表中的最高分的学生学号和课程号。

    select max(degree) from score ;

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

  • 相关阅读:
    关于Oracle过程,函数的经典例子及解析
    describeType的使用
    Flash Pro CS5无法跳过注册Adobe ID的问题
    DOM的滚动
    Flex的LogLogger类
    浏览器无法打开Google服务
    as3中颜色矩阵滤镜ColorMatrixFilter的使用
    仿Google+相册的动画
    Flex中ModuleManager的一个bug
    有序的组合
  • 原文地址:https://www.cnblogs.com/dnf1612/p/6169017.html
Copyright © 2011-2022 走看看