MySQL database table management (add and revise)

Source: Internet
Author: User

table field Management

1. Add to end

ALTER TABLE name add field name data type;


2 Add to start

ALTER TABLE name add data type first;


3. Add to the specified location

ALTER TABLE name add new field name data type after original field name;


4. Delete a field

ALTER TABLE name drop field name;


5. Modifying data Types

ALTER TABLE name modify field name new data type;


6. Modify the field name

ALTER TABLE name change old name new name data type;


7. Modify the table name:

ALTER TABLE name rename new table name;


Table Records Management

1. Update table Records

Update table name set field name = value 1, field name = value 2,...;


2. Delete Table Records

Delete from table name where= condition;

Delete must add a where condition, otherwise all records will be deleted


MySQL database table management (add and revise)

Related Article

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.