DML (data manipulation language); manipulation language
Insert data:
Insert data: Only one row of data can be inserted at a time
INSERT into table name (column name 1, column name 2, column name 3 ...) VALUES (value1, value2, value3 ...); Value corresponds to the number of columns one by one.
#插入一行:
INSERT into T_student (id,name,email,age) VALUES (null, ' Wang er ', ' [email protected] ', 23)
#插入部分值:
Inseryt to T_student (name, age) VALUES (' Zhao Si ', 40)
#插入多条数据: MySQL only
INSERT into T_student (name) SELECT name from T_student
UPDATE statement:
Updatae table Name set column Name 1 = value1, column name 2 = value2 ..., Whereid = 4
Note: If there is no where condition, all will be modified
#修改一个
UPDATE t_student set email= ' [email protected] ' WHERE id = 1
#修改多个
UPDATE t_student set email= ' [email protected] ', name= ' xiaoming ' WHERE id = 1
#注意不可以修改主键, not not. If you change the primary key, you won't find it next time.
Delete statement:
Delete from t_student WHERE [condition], deleting qualifying data
If there is no where, the data is emptied
Data manipulation language, DML, additions and deletions