zoukankan      html  css  js  c++  java
  • 学生选课数据库SQL语句练习题

    1、
    select Sname , Ssex  ,Class from t_hq_student;

    2、
    select distinct Depart from t_hq_teacher;

    3、
    select * from  t_hq_student;

    4、
    select * from t_hq_Score where Degree between 60 and 80;

    5、
    select * from t_hq_Score where Degree in('85','86','88');

    6、
    select * from  t_hq_student where class = '95031' and Ssex = '女';

    7、

    select * from t_hq_Student order by class desc;

    8、
    select cno as 课程号,degree as 成绩 from t_Hq_Score order by Cno asc,degree desc;

    9、

    select class,count(1)as 数量 from t_hq_Student group by class;

    10、select * from t_hq_Score where degree >= all (select degree from  t_hq_Score);


    11、
    select cno,count(1)as 数量 , avg(degree) as 平均值  from t_hq_Score  group by cno;


    12、
    select cno,count(1)as 数量,avg(degree) as 平均值 from t_hq_Score  where cno like '3%'group by cno having count(1) >=5;

    13、
    select Sno from t_hq_Score where degree between 70 and 90;

    14、查询所有学生的Sname、Cno和Degree列。

    Select s.sname,c.cno,c.degree from  t_hq_student s ,t_hq_score c where s.sno=c.sno;

    15、查询所有学生的Sno、Cname和Degree列。

    select c.sno,s.cname,c.degree from  t_hq_course s,t_hq_score c where c.cno = s.cno ;

    17、
    select avg(degree) as 平均值 from t_Hq_Score where sno in (select sno from t_Hq_student where class = 95033 );

    19、
    select * from t_hq_Score where Cno= '3-105' and degree > (select degree from  t_hq_Score where  Cno= '3-105' and Sno ='109');


    21、
     select * from t_hq_Score where degree > (select degree from t_hq_Score where sno = '109'and cno = '3-105' );

    23、查询“张旭“教师任课的学生成绩。
    select * from t_hq_Score where cno in(select cno from t_hq_course where tno in(select tno from t_hq_teacher where Tname = '张旭') );

  • 相关阅读:
    python实现单线程多任务非阻塞TCP服务端
    sudo命令
    ajax 未加载出数据时,显示loding,数据显示后,隐藏loading
    ie7 解决圆角,阴影问题
    学习JavaScript你必须掌握的8大知识点!
    es6 个人笔记
    原生js,实现单选框
    原生js开发简单复选框,点击变颜色,再点击取消颜色,三种解决方法
    es6对象转数组
    JS正则截取两个字符串之间及字符串前后内容的方法
  • 原文地址:https://www.cnblogs.com/chenning/p/4916546.html
Copyright © 2011-2022 走看看