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 = '张旭') );

  • 相关阅读:
    Spring Boot整合RabbitMQ
    程序员都在用的 IDEA 插件(不断更新)
    Skywalking03:Skywalking本地调试
    Skywalking01:Skywalking介绍
    Skywalking05:在Skywalking RocketBot上添加监控图表
    Skywalking04:扩展Metric监控信息
    文档,不仅仅是文档。
    pyecharts的绘图原理详解
    JS的新趋势State of JS 2020(来自网络)
    花半秒钟看透事物本质
  • 原文地址:https://www.cnblogs.com/chenning/p/4916546.html
Copyright © 2011-2022 走看看