MySQL database--Data deletion and modification

Source: Internet
Author: User

Main content:

    • Inserting data Insert
    • Updating Data Update
    • Deleting data Delete

Again to review some of the operations we have done before, I believe we all have a comprehensive understanding of inserting data, updating data, deleting data. So the most important thing in MySQL is not the three operations, but the most important to check the data.

In MySQL management software, you can use the DML language in SQL statements to implement data manipulation, including1inserting data by using Insert2. Update to implement data updates3. Using Delete to implement data deletion4. Use Select to query data and. Second, insert dataINSERT1Insert full data (sequential insert) syntax one:INSERT  intoTable name (field 1, Field 2, Field 3 ...) Field N)VALUES(value 1, value 2, value 3 ...)    Value n); Syntax Two:INSERT  intoTable nameVALUES(value 1, value 2, value 3 ...) Value n);2. Specify fields to insert data syntax:INSERT  intoTable name (field 1, Field 2, Field 3 ...)VALUES(value 1, value 2, value 3 ...);3. Insert multiple record syntax:INSERT  intoTable nameVALUES(value 1, value 2, value 3 ...) Value n), (value 1, value 2, value 3 ...) Value n), (value 1, value 2, value 3 ...) Value n); 4. Insert query result syntax:INSERT  intoTable name (Field 1, Field 2, Field 3 ...) Field N)SELECT(Field 1, Field 2, Field 3 ...) Field N) fromTable 2WHERE...; Updating the data update syntax:UPDATETable nameSETField 1=value 1, field 2=value of 2,WHERECONDITION; Example:UPDATEMysql.User SETPassword=Password ('123')where User=' Root ' andHost=' localhost '; Delete data delete syntax:DELETE  fromTable nameWHEREconition; Example:DELETE  fromMysql.User         WHEREPassword=’’;

MySQL database--Data deletion and modification

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.