MySQL Modify data sheet

Source: Internet
Author: User

ALTER [IGNORE] table Tb_name alter_spec,alter_spec ....

Alter_specification:

ADD [COLUMN] create_definition [first| After column_name]--Add a new field

Add index [index name] (index_col_name)--Adds an indexed name

Add PRIMARY Key (index_col_name)--Adding a primary key name

Add unique [index_name] (index_col_name)--Adding a unique index

ALTER [COLUMN] col_name {SET DEFAULT literal | DROP DEFAULT}--Modify the field name

Change [COLUMN] old_col_name create_definition--Modify field type

MODIFY [COLUMN] create_definition--Modify sentence definition field

Drop [COLUMN] col_name--delete field name

Drop PRIMARY Key--Delete primary Key name

Drop INDEX Index_name--Remove the name

RENAME [As] new_tb_name--Change table name

MySQL Modify data sheet

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.