查询
select * from 表名 where 条件
模糊查询
select * from table1 where field1 like %李% (%li , li %) %功能自己百度去
select * from table1 where field1 = 李_ _(_只能代替一个值)
更新数据
update 表名 set field = value1 where 条件
插入记录
insert into table1 (field1,field2,... ) values ( value1,value2,... )字段与值一 一对应
排序
order by field desc降序(不写desc 默认升序)
分组
group by field
having 条件 (having比where功能强大,一般用在group 以后)
创建表
create table table1 (field1 数据类型 primary key ,field2 int(9)not null ,.... )
跑路专用
drop database 数据库名
查询哪些表里包含某个字段名
select table_name,column_name from information_schema.columns where column_name like '%lan%';