一、
1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 |
C | D | C | A | B | A | C | A | C | A | A | C | B | D | A |
no | 答案 |
1. | 17、-215、13.4400、-18.4560 |
2. | @ |
3. | 12 |
4. | beautiful、我心中的太阳 |
5. | BEAUTIFAL, 我心中的太阳 |
6. | 聚簇索引 非聚簇索引 |
7. | 实体、域 |
8. | 表、视图 |
9. | 6、7 |
10 | 13.4300、13.4570 |
11 | 视图、存储过程 |
12 | 1931 |
13 | 域完整性 |
14 | 触发器 |
15 | 都完成、都取消 |
(一)
no | 参 |
1. | create database [我班同学数据库] go use [我班同学数据库] go |
2. | create table 宿舍表 ([宿舍号] char(6) primary key, [宿舍电话] char(7) check([宿舍电话] like '633[0-9][0-9][0-9][0-9]')) |
3. | create table 同学表 (学号 char(6) primary key, 姓名 nchar(4) not null, 性别 nchar(1) check(性别 in ('男', '女')), 年龄 int , 民族 nchar(8) default '汉族' not null, 身份证号 char(18) unique, 宿舍号 char(6) references 宿舍表(宿舍号) ) |
4. | insert 宿舍表 values('101', '6331157') insert 宿舍表 values('102', '6331777') update 宿舍表 set 宿舍电话='6331158' where 宿舍号='101' delete 宿舍表 where 宿舍号='102' |
5. | create view [同学表视图] as select 学号, 姓名, 性别, 年龄, 民族, 身份证号, 同学表.宿舍号, 宿舍电话 from 同学表,宿舍表 where 同学表.宿舍号=宿舍表.宿舍号 |
6. | select 姓名, 性别, 宿舍电话 from 同学表视图 where 姓名 like '张%' and 性别='女' |
7. | select 最大年龄 = max(年龄), 最小年龄 = min(年龄), 平均年龄 = avg(年龄) from 同学表 where 性别='女' |
8. | create procedure [某宿舍同学] @宿舍号 varchar(6) as select 姓名, 性别, 宿舍电话 from 同学表视图 where 宿舍号 = @宿舍号 go execute [某宿舍同学] '101' |
no | 参 |
1. | create database [学生成绩数据库] go use [学生成绩数据库] go |
2. | create table 课程信息表 ([课号] char(6) primary key, [名称] nchar(20) not null) |
3. | create table 学生信息表 ([学号] char(6) primary key, [姓名] nchar(4) not null, [性别] nchar(1) check([性别] in ('男', '女')), [民族] nchar(8) default '汉族' not null, [身份证号] char(18) unique ) |
4. | create table 成绩信息表 (ID int identity(1, 1), [学号] char(6) references 学生信息表(学号), [课号] char(6) references 课程信息表(课号), [分数] integer check([分数] between 0 and 100) ) |
5. | insert 课程信息表 values('100101', '西班牙语') insert 课程信息表 values('100102', '大学英语') update 课程信息表 set 名称='专业英语' where 课号='100102' delete 课程信息表 where 课号='100101' |
6. | create view [成绩信息表视图] as select 成绩信息表.学号,姓名,成绩信息表.课号,名称 课程名称,分数 from 成绩信息表,学生信息表,课程信息表 where 成绩信息表.学号=学生信息表.学号 and 成绩信息表.课号=课程信息表.课号 |
7. | select 姓名, 性别, 民族 from 学生信息表 where 姓名 like '刘%' and 性别='女' |
8. | select 学号, 姓名 from 学生信息表 where 学号 in (select distinct 学号 from 成绩信息表 where 分数<60) |
9. | create procedure [某门课程高低均分] @课程名 nchar(16) as select 课程名称, 最高分=max(分数), 最低分=min(分数), 平均分=avg(分数) from 成绩信息表视图 where 课程名称 = @课程名 group by 课程名称 go execute [某门课程高低均分] '专业英语' |