- First, Introduction
- Inserting data Insert
- Third, update data updates
- Iv. Deleting data Delete
- Five, query data select
- VI. Rights Management
First, Introduction
MySQL Data manipulation: DML
========================================================
In MySQL management software, you can use the DML language in SQL statements to implement data manipulation, including
- Inserting data by using insert
- Update to implement data updates
- Using Delete to implement data deletion
- Use Select to query data and.
========================================================
This section includes the following:
Inserting data
Update data
Delete data
Querying data
Inserting data Insert
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 ...;
Third, 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 ';
Iv. Deleting data Delete
Syntax: delete from table name where conition; Example: delete from Mysql.user where password= ';
Five, query data select
Single-table query: http://www.cnblogs.com/ManyQian/p/9026285.html
Multi-table query: http://www.cnblogs.com/ManyQian/p/9026606.html
VI. Rights Management
#授权表user #该表放行的权限 for: All data, all tables under all libraries, and all the fields under the table db #该表放行的权限, for: a database, all tables under that database, and all the fields under the table Tables_priv #该表放行的权限. For: A table, and all fields under the table Columns_priv #该表放行的权限, for: A field # interpreted by the figure: User: Release db1,db2 and all of the db it contains: Release DB1, and all Tables_priv that DB1 contains: Release Db1.table1, and all columns_prive included in the table: Release Db1.table1.column1, release the field only
PS: Specific operation, subsequent updates ...
Basic operation and basic form of mysql-common data