数据库第五次作业
- 1、下载文档前请自行甄别文档内容的完整性,平台不提供额外的编辑、内容补充、找答案等附加服务。
- 2、"仅部分预览"的文档,不可在线预览部分如存在完整性等问题,可反馈申请退款(可完整预览的文档不适用该条件!)。
- 3、如文档侵犯您的权益,请联系客服反馈,我们会尽快为您处理(人工客服工作时间:9:00-18:30)。
1.
use student
go
select*from student
where Sname notlike'刘%'
go
2.
use student
go
select*from student
where Sname like'沈__'
go
3.
use student
go
select*from student
where 2017-Sage=1985
go
4.
use student
go
select sno,sname,sage,sdept,ssex= case ssex
when'女'then'女生'
when'男'then'男生'
else'条件不明'
end
from student
go
5.
use student
go
select*from course
where Cname like'&数据&'
go
6.
use student
go
select sno,Sname,Ssex,Sage,sdept from student where sno like'_______[1239][1239]%'
go
7.
use student
go
select*from sc
where Cno=1 orderby grade asc
go
8.
use student
go
select sno from sc
where cno=1 and sno in(select sno from sc where Cno=2) go
9.
use student
go
select*from course
orderby cpno asc
go
10.
use student
go
select*from student
where sage>(select AVG(sage)from student)
orderby sage desc
go
11.
use student
go
select sno学号,sname姓名,ssex性别,2017-sage出生年份,sdept院系from student orderby 2017-Sage asc
go
12.
use student
go
select sdept=
case