zoukankan      html  css  js  c++  java
  • 数据库练习解答--1-8题解答

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

    Select t.sname,t.ssex,t.sclass from student t;

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

    Select * from teacher t where t.depart='计算机系';

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

    Select *from student t;

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

    Select * from student t where t.sno in (select e.sno from score e where degree between 60 and 80);

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

    Select * from student t where t.sno in (select e.sno from score e where e.degree='85'or e.degree='86'or e.degree='88');

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

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

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

    select * from STUDENT t order by sclass;

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

    select * from score t order by cno asc,degree desc;

     

     

  • 相关阅读:
    wget时http无效问题
    mysql8.0.15的最简单安装
    创建时间时jdbcType使用的准确性
    fastJson的几种转换模式
    (mybatis)EnumTypeHandler和EnumOrdinalTypeHandler的区别
    在文件上传时fileName.endsWith()的获取后悔
    day22
    day21
    day20
    day19
  • 原文地址:https://www.cnblogs.com/tfl-511/p/5951441.html
Copyright © 2011-2022 走看看