-- testindex:表名
desc testindex; -- 显示表的字段信息
show columns from testindex; -- 显示表的字段信息
show create table testindex; -- 显示表的定义

select column_name from information_schema.columns where table_schema='db_name'; -- 显示数据库db_name的表的字段名
show tables; -- 显示所有的表名
show tables from db_name; -- 显示数据库db_name中的所有表名
select table_name from information_schema.tables where table_schema='db_name'; -- 显示数据库db_name中的所有表名

alter table testindex add stu_status tinyint; -- 添加字段
alter table testindex drop stu_status; -- 删除字段
alter table testindex modify stu_id tinyint; -- 修改字段类型
alter table testindex change id stu_id tinyint; -- 改变字段名称 id:原字段名称 stu_id:新字段名称

alter table c add testcomment varchar(10) comment '测试comment'; -- comment 添加对字段的注释