1 创建索引
CREATE [UNIQUE]%指定索引是否唯一 [CLUSTERED | NONCLUSTERED]%索引的组织方式 INDEX index_name%索引的名称 ON {[database_name.[schema_name]. | schema_name.] table_or_view_name} (column[ASC | DESC][,...n])%定义索引的依据 [INCLUDE (column_name[,...n])] [WITH(<relation_index_option>[,...n])]%索引选项 [ON{partition_scheme_name(column_name)%指定分区方案 | filegroup_name | default}]%指定索引所在的文件组 [;]
%为KCB表的课程名创建索引 USE PXSCJ GO CREATE UNIQUE CLUSTERED INDEX name ON KCB(课程名)