ImageVerifierCode 换一换
格式:DOC , 页数:8 ,大小:18.18KB ,
资源ID:1442005      下载积分:5 文钱
快捷下载
登录下载
邮箱/手机:
温馨提示:
快捷下载时,用户名和密码都是您填写的邮箱或者手机号,方便查询和重复下载(系统自动生成)。 如填写123,账号就是123,密码也是123。
特别说明:
请自助下载,系统不会自动发送文件的哦; 如果您已付费,想二次下载,请登录后访问:我的下载记录
支付方式: 支付宝    微信支付   
验证码:   换一换

加入VIP,省得不是一点点
 

温馨提示:由于个人手机设置不同,如果发现不能下载,请复制以下地址【https://www.wenke99.com/d-1442005.html】到电脑端继续下载(重复下载不扣费)。

已注册用户请登录:
账号:
密码:
验证码:   换一换
  忘记密码?
三方登录: QQ登录   微博登录 

下载须知

1: 本站所有资源如无特殊说明,都需要本地电脑安装OFFICE2007和PDF阅读器。
2: 试题试卷类文档,如果标题没有明确说明有答案则都视为没有答案,请知晓。
3: 文件的所有权益归上传用户所有。
4. 未经权益所有人同意不得将文件中的内容挪作商业或盈利用途。
5. 本站仅提供交流平台,并不能对任何下载内容负责。
6. 下载文件中如有侵权或不适当内容,请与我们联系,我们立即纠正。
7. 本站不保证下载资源的准确性、安全性和完整性, 同时也不承担用户因使用这些下载资源对自己和他人造成任何形式的伤害或损失。

版权提示 | 免责声明

本文(SQL语句练习题答案.doc)为本站会员(h****)主动上传,文客久久仅提供信息存储空间,仅对用户上传内容的表现方式做保护处理,对上载内容本身不做任何修改或编辑。 若此文所含内容侵犯了您的版权或隐私,请立即通知文客久久(发送邮件至hr@wenke99.com或直接QQ联系客服),我们立即给予删除!

SQL语句练习题答案.doc

1、 school student , sc, course school student (sno,sname,ssex,sage,sdept) course(cno,cname,cpno,ccredit) sc(sno,cno,grade) 1. studentsno2 coursecno 3 scsnocno1 create table student , sc, course sql23 student4schoolstudent5studentsbirthdate datetimedelete1. jsj delete from student where sdept=jsj and s

2、sex=; 2 -delete from sc where cno in (select cno fromcourse where cname=-);update1. 0001 : jsj2. 1 2 1001 93 3 -1select 11921, 22 3 10014jsj sxwl 25, 510sno,cno,101-10 1 11-202 30-39390-10010 6 student distinct 7000110011002 1 2jsj 34 5 1001,1002 6 80 7 2 8 1085 9 10 1 jsj 21002 (2 3-4- 80 (2 5, 675

3、7( 1. 2. 1002 3. 2 top , any , all *4 100110025 10022 6 7 jsj 198 10019085 9 10 1. create table student (snochar(6), sname varchar(8), ssexchar(2), sagesmallint, sdept varchar(15), primary key(sno);create table sc(snochar(6), cno char(4),grade decimal(12,2), primary key(sno,cno);insert into studentv

4、alues( 4001,20,sx)delete from studentdrop table studentalter table student add sbirthdate datetime1. select sno, sname, sage from studentwhere ssex= and sage between 19 and 21order by sage desc; 2 select sno, ssexfrom studentwhere sname like _% ; 3 select sno, cnofrom scwhere grade is null and cno=1

5、001 ; 4 select sno, sname from studentwhere sdept in (jsj,sx,wl) and sage25 group by sdept;select sno, cno, grade/10.0+1 as levelfrom sc ;select distinct sdept from student ; select grade from scwhere sno=0001 and (cno=1001 or cno=1002) ;select count(*) from student where sname like % ; select avg(s

6、age),max(sage) from student where sdept=jsj ; select cno,sum(grade),avg(grade),max(grade),min(grade) from sc group by cnoorder by avg(grade) desc ;select cno, avg(grade) from sc where cno in(1001,1002) group by cno ;select sc.sno ,avg(grade) from scgroup by sc.snohaving avg(grade)80 ;select sno from

7、 sc group by sno having count(*)2 ;select cno from sc where grade85 group by cno having count(*)=10 ; select sno from sc group by sno having avg(grade)60 ;select sno from sc where grade60 group by sno having count(*)2 ;select cno from student,sc where student.sno=sc.sno and sdept=jsj ; a:select snam

8、e from student,sc where student.sno=sc.sno and cno=1002b:select sname from student where sno in (select sno from sc where cno=1002)select sno,grade from sc,coursewhere o=o and cname=- and grade 60 a:select sname from student ,sc,coursewhere student.sno=sc.sno and o=o and grade80 and cname= - b:selec

9、t sname from student where sno in (select sno from sc where grade80 and cno in (select cno from course where cname= -) select sno,sname,avg(grade) from sc,studentwhere student.sno=sc.snogroup by student.sno having avg(grade)60a:select sname from student where ssex= and sno in(select sno from sc grou

10、p by sno having avg(grade)75)b:select sname from sc,student where student.sno=sc.sno and ssex=group by student.sno having avg(grade)75select student.sno,sname,cno,grade from student left join sc on student.sno=sc.sno and ssex=select count(*) from student where sno in( select sno from sc group by sno

11、 havingavg(grade)60)select sname from student where sno not inselect sno from sc where cno=1002student0001 aax 0002 bb0003 ccx sc0001 1001 0001 1002 0002 1001 0003 1002select sname from student where not exists(select* from sc where cno=1002 and sc.sno=student.sno)a:select top 1 sno,avg(grade) from

12、sc group by sno order by avg(grade) desc b:select sno, avg(grade) from sc group by snohaving avg(grade)=(select top 1 avg(grade) from scgroup by sno order by avg(grade) desc) c:select sno, avg(grade) from sc group by snohaving avg(grade)=all ( select avg(grade) from sc group by sno)select sname from

13、 student where not exists(select * from course where cno in(1001,1002) andnot exists(select * from sc where sno =student.sno and cno=o) ) a:select top 1 sno from sc cno=1002 order by grade desc b:select sno from sc where cno=1002 and grade =all (sqlsql1select * from 2select , from where =3select dis

14、tinct from 4180select , from where =1 and 80 order by desc5select from where select from where not =select from where !=67080select * from where =70 and =80select * from where between 70 and 80select * from where not between 70 and 80713select , from where =1 or =3select , from where in (1,3)select

15、, from where not in (1,3)898select * from where like 98%select * from where like 98_ _ _ _select * from where not like 98%9()select , from where is nullselect , from where is not null10select sum() as from 11select ,avg() as from group by 12select ,avg() as ,max() as ,;min() as ,count() as from grou

16、p by 11select , from , where .=. and =121select ., from s, x where s.=x. and =13150select .,sum() as from ,;where .=. group by . having sum()1501select a.,b., from a, b where a.b. and a.=b.212select x. from x, y where x.=y. and x.=1 and y.=23rate.dbf1 c(2)2 c(2) n(8,4) n(8,4).dbf1 c(4)2 c(4) n(8,4)

17、n(8,4).dbf c(10) c(10)rate12rate12select a. as 1,b. as 2,;, from a, b;where a.=.1 and b.=.2 into table rate4 c2 c6- c2-select ,s.,e. from s, e where s.=e.-11select , from , where .=. and =1select , from inner join on .=. where =1 innerselect , from join on .=. where =12select ., from ,;where .=. and

18、.=. ;and .=.select ., from join join join ;on .=. on .=. on .=.3select from where not in (select from )select from right join on .=. where .select from left join on .=. where .exists1select from where =(select from where =) existsselect from where exist (select * from ;where = and .=.)2select * from

19、 where in; (select from where =) select * from where exist (select * from where = ; and .=.)anysomeall121select , from where =2 and ;(select min() from where =1)anysomeanysomesqlsql1select * from 2select , from where =3select distinct from 4180select , from where =1 and 80 order by desc5select from

20、where select from where not =select from where !=67080select * from where =70 and =80select * from where between 70 and 80select * from where not between 70 and 80713select , from where =1 or =3select , from where in (1,3)select , from where not in (1,3)898select * from where like 98%select * from w

21、here like 98_ _ _ _select * from where not like 98%9()select , from where is nullselect , from where is not null10select sum() as from 11select ,avg() as from group by 12select ,avg() as ,max() as ,;min() as ,count() as from group by 11select , from , where .=. and =121select ., from s, x where s.=x

22、. and =13150select .,sum() as from ,;where .=. group by . having sum()1501select a.,b., from a, b where a.b. and a.=b.212select x. from x, y where x.=y. and x.=1 and y.=23rate.dbf1 c(2)2 c(2) n(8,4) n(8,4).dbf1 c(4)2 c(4) n(8,4) n(8,4).dbf c(10) c(10)rate12rate12select a. as 1,b. as 2,;, from a, b;where a.=.1 and b.=.2 into table rate4 c2 c6- c2-select ,s.,e. from s, e where s.=e.-11select , from , where .=. and =1select , from inner join on .=. where =1 innerselect , from join on .=. where =12select ., from ,;where .=. and.=. ;and .=.select ., from join join join ; on

Copyright © 2018-2021 Wenke99.com All rights reserved

工信部备案号浙ICP备20026746号-2  

公安局备案号:浙公网安备33038302330469号

本站为C2C交文档易平台,即用户上传的文档直接卖给下载用户,本站只是网络服务中间平台,所有原创文档下载所得归上传人所有,若您发现上传作品侵犯了您的权利,请立刻联系网站客服并提供证据,平台将在3个工作日内予以改正。