-- 删除数据库
drop database 数据库名;
-- 如果不存在则执行删除,如果存在则不执行任何操作(不报错)
drop database if exists 数据库名
-- 删除: 删除 tb_emp 表
-- drop table if exists 表名;
drop table if exists tb_emp;
-- 删除 tb_emp 的 qq_num 字段
-- alter table 表名 drop column 字段名;
alter table tb_emp drop column qq_num;
-- 1. 删除 tb_emp 表中 ID为1的员工
-- delete from 表名 where条件;
delete from tb_emp where id = 1;
-- 2. 删除 tb_emp 表中的所有员工
-- delete from 表名 ;
delete from tb_emp;
sql删除语法
于 2024-05-12 14:52:48 首次发布