从这道题出发,欢迎讨论聚集索引和非聚集索引的区别
为存储学院中学生的材料,创建Student表如下:
CREATE TABLE Student
(
cStudentCode char(3) not null,
cStudentName char(40) not null,
cStudentAddress char(50) not null,
cStudentState char(30) not null,
cStudentCity char(30) not null,
cStudentPhone char(40) not null,
cStudentEmail char(40) null
)
每天对Student表要执行许多基于学生代码的查询。
没有两个学生可以有相同的学生代码。
在每学期结束时要在Student表中输入新学生的材料。
为改进查询的性能。你应创建什么类型的索引?
1.cStudentCode属性上的群集索引。
2.cStudentCode属性上的非群集索引。
3.cStudentCode属性上的唯一性群集索引。
4.cStudentCode属性上的唯一性非群集索引。
========================
从这道题出发,欢迎大家讨论一下聚集索引和非聚集索引的区别以及这两种索引候选键的选择依据!