创建表
语法:
create table table_name(
field1 datatype,
field2 datatype,
)character set 字符集 collate 校验规则 engine 存储引擎;
查看表
语法:desc 表名;
修改表
1、新增属性
alter table 表名 add 属性名 属性类型 comment '注释';
2、更改列的大小
alter table 表名 modify 属性名 属性类型;
3、删除某一列
alter table 表名 drop 属性名;
4、修改表名
alter table 原表名 rename to 新表名;
5、修改字符集
alter table charset;
6、修改字段名(需要给出具体类型的定义)
alter table 表名 change 原属性名 新属性名 新属性类型;
删除表
语法:drop table table_name;