1. DML
2. DDL
3. 例子
-- 建表
use mydb;
createtable user(
userid int,
username varchar(20),
password varchar(20)
);
-- 添加字段到首列 first
-- alter table user add email VARCHAR(20) first;
-- 修改字段 change
alter table user change email email varchar(50) after userid;
-- 删除字段 drop
alter table user drop phone;
-- 批量插入数据
-- insert intouser(username,password,email)values('ls','123','ls@qq.com'),('ls','123','ls@qq.com');
-- 将user表中的数据整体插入到user2中
insert intousers select * from user
-- 更新操作
update tbname set 字段=新值 [where ]
update user set username = 'ww' where userid =3;
-- 删除操作
delete from tbname [where]
delete from user where userid = 4;