Modify table

create table seller(

        seller_id int primary key not null auto_increment comment '自增',

        seller_name varchar(45) not null comment'seller user name',

        seller_pwd varchar(45) not null comment'seller password',

        seller_tel bigint(20) not null comment'Seller's phone number',

        store_id int default null comment'Store ID',

        seller_status tinyint not null default "1" comment'Status, 1 is normal, 0 is disabled'

)comment='Store basic table';

 

Modify the comment of the table

alter table seller comment'Comment of the modified table';

Add a field:

alert table seller add `name` varchar(255) not null comment '新增name';  

Modify the comment of the field

alter table seller modify column seller_name varchar(20) comment'The name of the merchant';

Delete field

alter table seller drop seller_status;

Guess you like

Origin blog.csdn.net/qq_36774734/article/details/112512025