【正文】
AB 1620. DBA AB 2125 BABCA二、填空題 12. 規(guī)則對象 13. 查詢 14. 字段 15. check三、實踐題2.2.use libararygocreate table 學生(學號 char(8) not null,姓名 varchar(20) not null,性別 char(2),院系 varchar(20))gocreate table 借閱(學號 char(8) not null,書名 char(6) not null,借書日期 datetime,還書日期 datetime)go(1)use librarygo alter table 學生 add 民族 varchar(6)constraint df_學生_民族 default 39。Go(9)exec sp_bindrule 39。go(10)exec sp_addtype 編號,39。習題六一、選擇題15. CCBAB 1620. BCCCA 2125ADDCC 2630 CDCBC二、填空題 3.[] by by by 12. where 13. 相關子查詢 14. 交叉連接 15. all 16. with rollup 17. distinct18. from子句 19. 嵌套查詢 20. truncate table 三、實踐題1. select , 學生a,學生b where = and !=2.select 學號,39。6.select * from 學生 where 性別=39。)goselect * from 學生 where 性別=39。)7.select* from 學生 order by 總分desc8.select ,姓名,性別,課程號,成績 from 學生,選修where = and 成績859.select 姓名,39。unionselect 姓名,39。10.select * from 學生where 出生日期 between 39。11.select top 5 * into course from 課程12.select 籍貫,count(*) from 學生 group by 籍貫13.select 學號,姓名,籍貫 from 學生 where 籍貫=39。goselect,count(*) from 學生where 籍貫=39。 order by left(學號,6)pute count(籍貫) by left(學號,6)或select 學號,姓名,籍貫 from 學生where 籍貫=39。 group by left(學號,6)15.select * from 學生 a where 出生日期=(select max(出生日期) from 學生 b where =)16.select * from 選修 a where 成績(select avg(成績) from 選修 b where =)17.select * from 選修 where 成績(select avg(成績) from 選修)略習題七一、填空題 8. max()9. waitfor 11. sysments 12. ‘a(chǎn)b’ 13. 當前系統(tǒng)日期時間的字符 14. TSQL 15. GO 16. 批處理17. Unicode 18. 內(nèi)嵌表值 19. smalldatetime 20. smallmoney二、選擇題15DCBDA 610DCDBD 1115 ACBDB 1620. BDBAB 2125 DCCBC三、實踐題1.declare a int,b int,c floatset a =10set b=20set c=a*bprint c2.declare i tinyint,j tinyintset i=1while i=4begin set j=2*i1 print space(202*i)+ replicate(39。)returns table as return(select ,姓名,性別,課程號,班