mysql-Data manipulation

Source: Internet
Author: User

Read Catalogue

    • An introduction
    • Two Insert data inserts
    • Three Update data updates
    • Four delete data deletes
    • Five query data Select
back to topAn introduction

MySQL Data manipulation: DML

========================================================

In MySQL management software, you can use the DML language in SQL statements to implement data manipulation, including

    1. Inserting data by using insert
    2. Update to implement data updates
    3. Using Delete to implement data deletion
    4. Use Select to query data and.

========================================================

This section includes the following:

Inserting data
Update data
Delete data
Querying data

back to topTwo Insert data inserts
1. Insert full data (sequential insert)    syntax One:    insert into table name (Field 1, Field 2, Field 3 ...) field N) VALUES (value 1, value 2, value 3 ...) Value n);    Syntax two:    INSERT into table name values (value 1, value 2, value 3 ...) Value n); 2. Specify field Insert data    syntax:    insert INTO table name (Field 1, Field 2, Field 3 ...) Values (value 1, value 2, value 3 ...); 3. Insert multiple record    syntax:    insert INTO table name values        (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 INTO table name (Field 1, Field 2, Field 3 ...) Field N)                     SELECT (Field 1, Field 2, Field 3 ...) field N) from table 2                    WHERE ...;

back to topThree Update data updates
Syntax:    Update table name set        field 1= value 1,        field 2= value 2,        where CONDITION; example:    update mysql.user set Password=password (' 123 ')         where user= ' root ' and host= ' localhost ';

back to top Four delete data deletes,
Syntax:    delete from table name         where conition; Example:    delete from Mysql.user         where password= "; Practice:    update MySQL Root user password for mysql123    remove all users except the root user logged on locally

back to topFive query data Select

mysql-Data manipulation

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.