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;

     

     

  • 相关阅读:
    idea 相关
    dns 相关
    bash 相关
    建造者模式(Builder)
    C#中out 及 ref 区别
    C# 2.0新特性
    Asp.net.Ajax控件学习
    装饰模式(Decorator Pattern)
    职责链模式(Chain of Responsibility Pattern)
    面向对象
  • 原文地址:https://www.cnblogs.com/tfl-511/p/5951441.html
Copyright © 2011-2022 走看看