1. Increase (insert)
1. Commonly used
insert into 表名 values(v1,v2.....);
2. Add specified fields
insert into 表名[(字段1 ...)] values(v1 ....);
Two, delete (delete)
1.delete from 表名 where 条件;
2. Note: .truncate statement (use with caution) This statement is also used to delete the table and cannot be recovered
truncate table 表名;
Three, modify (update)
update t_name set 字段1 = 新值, 字段2 = 新值 ... where 条件 ;
Four, search (select)
The result of the query is also a virtual table
1. View all the contents of the table
select * from 表名;
2. Look up the specified field in the table
select 字段1,字段2.... from 表名;
Five, simple modification to the table (alter table)
1. Add new fields
alter table 表名 add 字段名 字段类型 约束条件;
2. Modify the field type
alter table 表名称 modify 字段名 字段类型;
3. Modify the field name
alter table 表名称 change 旧字段名 新字段名 字段类型;
4. Modify the table name
1.alter table 旧表名 rename 新表名;
2.rename table 旧表名 to 新表名;
Six, copy of the table
1.create table 新表名 like 源表;
2.create table 新表名 select * from 源表;