Mysql adds columns to modify column name attributes and deletes columns _ MySQL

Source: Internet
Author: User
Mysql adds a column to modify the column name attribute and deletes the column bitsCN.com

First, I would like to recommend a book for beginners, a booklet: "mysql must know", which is practical and authoritative. it was a little expensive and I bought it yesterday.

Http: // ebook/201112/30389 .html

Body:

Mysql modifies the table name, column name, column type, adds a table column, and deletes a table column.

Modify the table name (testtable, newtablename)

Alter table testtable rename newtablename;

Add table columns:

Alter table testtable add column name varchar (40 );

Delete column:

Alter table testtable drop column name;

Modify the column type:

Alter table testtable modify address char (40)

Alternatively, alter table testtable change address char (40)

Alter table column name

Alter table testtable change column address address1 varchar (30)

Author naturebe

BitsCN.com

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.