以下为《SQL 练习题》的无排版文字预览,完整格式请下载
下载前请仔细阅读文字预览以及下方图片预览。图片预览是什么样的,下载的文档就是什么样的。
SQL 练习题
单表信息查询
查询Student表的所有记录
select * from student
查询Student表所有记录的Sname,Ssex,Class信息。
Select Sname,Ssex,Class from student
3、查询教师所有的单位即不重复的Depart列。
select distinct depart from teacher
查询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 class='95031' or Ssex='女'
以Class降序查询Student表的所有记录
select * from student order by class desc
以Cno升序、Degree降序查询Score表的所有记录
select * from Score order by cno asc, degree desc
查询Student表中不姓“王”的同学记录
select * from Student where Sname not like '王%%'
10、查询分数大于70,小于90的Sno和degreeg两列
selectSno,degree from Score where degree>70 and degree请点击下方选择您需要的文档下载。
以上为《SQL 练习题》的无排版文字预览,完整格式请下载
下载前请仔细阅读上面文字预览以及下方图片预览。图片预览是什么样的,下载的文档就是什么样的。