查询数据库:show databases;
创建数据库:create database 库名;
删除数据库:drop database 库名
创建表:create table 表名(字段名 数据类型【属性】【索引】)
查看表结构:desc 表名
查看表:show tables
插入数据:insert into 表名 value()
查看创建表信息:show create table 表名
查看指定库的表:show tables where 目标库名
字段
增加:alter table 表名 add 字段名 数据类型 【属性】【索引】
往指定位置后面插入字段:alter table 表名 add 字段名 数据类型 【属性】 【索引】after 指定的字段名
往第一个位置插入:alter table 表名 add 字段名 数据类型【属性】【索引】first
删除:alter table 表名 drop 字段名
修改:alter table 表名 change 旧字段 新字段 数据类型 【属性】【索引】
条件语句:> = <= != and or 等等
数据
添加:insert into 表名 value()
删除:delete from 表名 (慎用,删除整个表数据)
delete from 表名 where 条件语句
修改:update 表名 set 字段名=值 where 条件语句
★查询:精确查