SQL Series (12)--insert Update Delete

Source: Internet
Author: User
Tags bulk insert

Objective

The front of this series is all about querying select. But the SQL is very extensive, according to the different processing of data can be divided into:

    • DML: Full data manipulation Language, as can be seen from the name, DML is the maintenance of the data management language, mainly to deal with the information itself;
    • DDL: Full data definition Language, also from the name can be seen, DDL data definition language, mainly used to manipulate libraries, tables, views, indexes, etc., mainly on the operation of data structures;
    • DCL: The full Data Control Language, as can be seen from the name, is the language of the controls, mainly used to control data, such as processing data access rights;
    • TCL: Full name transaction Control Language, from the names can be seen, is used to deal with transactions;

Each language is divided into a number of actual SQL statements:

type SQL Statement
Dml SELECT, INSERT, UPDATE, DELETE
Ddl CREATE, ALTER, DROP, COMMENT
DCL GRANT, REVOKE
Tcl COMMIT, ROLLBACK, SET TRANSACTION


Additional DDL syntax for inserting data

Grammar:

INSERT INTO TABLE_NAME (column1, column2...columnJ) value (?, ?...?);INSERT INTO TABLE_NAME (column1, column2...columnJ) values (?, ?...?), (?, ?...?), (?, ?...?);

From the above you can see that insert has two ways of writing, single insert and BULK INSERT.

Update data

Grammar:

UPDATE TABLE_NAME SET column1 = ?, column2 = ? [WHERE condition]

You can see that updates can be selected with one or more columns of updates, or a more where condition, optionally updating the specified column of the corresponding row.

Delete data

Grammar

DELETE FROM TABLE_NAME [WHERE condition]

When you delete, you can choose to use the Where condition to specify that the data for the row be deleted, otherwise all data will be deleted

SQL Series (12)--insert Update Delete

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.