1. 程式人生 > >mysql中表的創建,修改刪除

mysql中表的創建,修改刪除

class 一個 刪除 sql mysq creat name pass 添加

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中表的創建,修改刪除