zoukankan      html  css  js  c++  java
  • 关于SQLite作业

    --查询Student表中的所有记录的Sname、Ssex和Class列。
    SELECT sname,ssex,class from Student

    --查询教师所有的单位即不重复的Depart列。
    SELECT DISTINCT depart from Teachear

    --查询Student表的所有记录。
    SELECT * from Student

    --查询Score表中成绩在60到80之间的所有记录。
    SELECT * from Score where Degree BETWEEN 60 and 80

    -查询Score表中成绩为85,86或88的记录。
    SELECT * from Score WHERE Degree IN('85','86','88')

     

    --查询Student表中“95031”班或性别为“女”的同学记录。
    SELECT * FROM Student WHERE Ssex='女'AND Class='95031''

    --以Class降序查询Student表的所有记录。
    SELECT * FROM Student ORDER BY class DESC

    --以Cno升序、Degree降序查询Score表的所有记录。
    SELECT *from Score ORDER BY degree DESC,cno asc

    --查询“95031”班的学生人数。
    SELECT count(*) from Student WHERE Class='95031'

    -查询Score表中的最高分的学生学号和课程号
    --SELECT a.Sno,b.Sname,a.Cno,a.Degree FROM Score a,Student b,Course c WHERE a.Sno = b.Sno and a.Cno=c.Cno and a.Cno='3-245'
    select * from score order by degree desc --答案

    --查询每门课的平均成绩。
    SELECT cno,avg(degree) from Score GROUP BY Cno

    --查询Score表中至少有5名学生选修的并以3开头的课程的平均分数。
    SELECT avg(degree) FROM Score WHERE cno in (SELECT cno from Score GROUP BY cno having count(*)>5) and cno LIKE '3%' GROUP BY Cno

    --查询分数大于70,小于90的Sno列。
    --SELECT * FROM Score WHERE Degree BETWEEN 70 and 90
    SELECT sno from Score WHERE Degree BETWEEN 70 and 90 --答案

  • 相关阅读:
    DEM、DSM、DOM 名词解释
    html checkbox样式美化
    通过Ajax方式上传文件(input file),使用FormData进行Ajax请求
    C# 读取指定文件夹下所有文件
    ASP.NET 实现Base64文件流下载PDF
    Asp.Net使用百度编辑器(ueditor)
    asp.net 伪静态实现(UrlRewritingNet)
    C# 各种类型的转换
    asp.net操作word 配置在IIS上出现的问题
    plupload 上传组件的使用
  • 原文地址:https://www.cnblogs.com/TENOKAWA/p/5545839.html
Copyright © 2011-2022 走看看