Home > Database > Mysql Tutorial > MySQL创建index示例_MySQL

MySQL创建index示例_MySQL

WBOY
Release: 2016-06-01 13:40:31
Original
1120 people have browsed it

bitsCN.com
MySQL创建index示例 环境:MySQL Sever 5.1 + MySQL命令行工具 问题:创建索引 CREATE INDEX 语法: CREATE [UNIQUE|FULLTEXT|SPATIAL] INDEX index_name[index_type]    ON tbl_name (index_col_name,...)[index_type] index_col_name:col_name [(length)] [ASC| DESC] index_type:USING {BTREE | HASH |RTREE} 示例: [sql] -- 创建无索引的表  create table testIndex (     id int not null primary key,     name varchar(10)    );          -- 创建普通索引    create index IDX_test_testIndex _Name on testIndex(name);    说明:索引的命名最好采用此种方式:IDX_databaseName_tableName_columnName(IDX表示索引,databaseName表示数据库名,tableName表示表名,columnName表示字段名,如果Oracle下不存在数据库的概念,取而代之的是表空间,所以databaseName替换成用户名即可)。 参考资料:MySQL里创建索引(Create Index)的方法和语法结构及例子http:///database/201209/155472.html bitsCN.com

Related labels:
source:php.cn
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template