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
- 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
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