1. 创建表
create table tableName(
name varchar(50),
age int,
gender varchar(10),
height int,
weight int,
);
2. 删除表
drop table tabeName;
3. 改(重命名)
rename table oldName(旧表名) to newName(新表名);
4. 查看表
show tables;
show select table tableName(表名);
desc tableName(表名);
5. 字段的增删操作
alter table tableName(表名) add colName(字段名) type(字段类型);
alter table tableName(表名) drop colName(字段名)
6. 字段的修改操作
alter table tableNmae(表名) modify colName(字段名) newType(新的字段类型);
alter table tableName(表名) change oldColName(原来的字段名) newColName(新字段名) newType(新字段类型);
alter table tableNmae(表名) character set charsetName(字符集名);
7. 其他操作
create table stu like student;
show columns form tableName;