MySQL CreateIndex method and syntax structure and example

Source: Internet
Author: User
Tags createindex mysql create mysql create index
MySQL CreateIndex method and syntax structure and example

MySQL Create Index method and syntax structure and example

Create index Syntax

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}
The Code is as follows:
-- Create a table without Indexes
Create table testNoPK (
Id int not null,
Name varchar (10)
);
-- Create a common index
Create index IDX_testNoPK_Name on testNoPK (name );

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.