mysql中表的创建,修改删除

Posted imageSet

tags:

篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了mysql中表的创建,修改删除相关的知识,希望对你有一定的参考价值。

create table table_user(
id int(3),
name varchar(8),
password varchar(20));#创建一个表,有3个字段

alter table table_user rename to tab_user;#更改表名

alter table tab_user add email varchar(255) not null;#添加一个字段,字段非空

alter table tab_user change id newid int(3);#修改字段名

alter table tab_user drop email;#删除一个自段

drop table tab_user;删除表

 

以上是关于mysql中表的创建,修改删除的主要内容,如果未能解决你的问题,请参考以下文章