MySQL基本数据操作

MySQL基本数据操作

1.插入数据

insert into tb_name(col_name,col_name2,....)values(value1,value2,......);

2.更新数据

update tb_name set col_name=new_value1,col_name2=new_value2,......where condition;

3.删除数据

delete [low_prioprity] [quick] [ignore] from tb_name

[WHERE where_definition]          --指定条件

[ORDER BY....]         --按照条件删除

[LIMIT row_count]                    --控制显示条数

truncate

TRUNCATE [TABLE] tb_name;