删除数据
(1)语法
delete from 表名 where 条件
(2)删除所有的数据
delete from tb_user ;
(3)删除学号为1学生数据
delete from tb_user where id = 1 ;
(4)删除名字为ww学生数据
delete from tb_user where name = ‘ww’ ;
(5)删除所有数据
truncate table tb_user;
(6)delete和truncate区别(面试题)
delete:一行一行的把数据删除。
truncate:先删除表(drop),重新创建(create)表