文档详情

数据库实训三答案.doc

发布:2017-08-01约1.92千字共3页下载文档
文本预览下载声明
1、 create database student on primary (name=student1, filename=d:\data\student1.mdf, size=10mb, maxsize=100mb, filegrowth=10% ), (name=student2, filename=d:\data\student2.ndf, size=20mb, maxsize=100mb, filegrowth=1mb ) log on (name=studentlog1, filename=d:\data\studentlog1.ldf, size=10mb, maxsize=50mb, filegrowth=1mb), (name=studentlog2, filename=d:\data\studentlog2.ldf, size=10mb, maxsize=50mb, filegrowth=1mb) 2、 alter database student add filegroup file1 alter database student add file (name=student3, filename=d:\data\student3.ndf, size=5mb, maxsize=20mb, filegrowth=15% )to filegroup file1 alter database student remove file student3 3、 create table 学生表 (学号char(6) not null primary key, 姓名char(8) not null, 年龄int not null, constraint ck_age check (年龄between 16 and 30), 性别char(2) default(女) ) 4、 alter table 学生表 add 家庭地址varchar(30) alter table 学生表 add 学生所在系char(20) 5、 alter table 学生表 add constraint df_age default(20) for 年龄 6、 insert into 学生表 values(021101,王英,20,女,绍兴路,交通工程系) insert into 学生表 values(022111,吴波,20,男,延安路,汽车系) insert into 学生表 values(034320,李霞,20,女,南山路,管理信息系) insert into 学生表 values(031202,张兵,20,女,北山路,汽车系) 7、 update 学生表 set 学生所在系=管理信息系 where 姓名=王英 update 学生表 set 家庭地址=解放路 where 姓名=吴波 delete from 学生表 where 学生所在系=管理信息系 8、 create unique nonclustered index in_xm on 学生表(姓名desc) 9、 create nonclustered index ix_年龄on 学生表(年龄desc,学号asc) 10、 create nonclustered index address on 学生表(家庭地址) with pad_index,fillfactor=80 select indexproperty(object_id(学生表),address,ispadindex) 11、 drop index 学生表.address create nonclustered index address on 学生表(家庭地址) with pad_index,fillfactor=90 12、 drop index 学生表.address 13、 drop table 学生表 14、 drop database student
显示全部
相似文档