當前位置:學問君>人在職場>電腦培訓>

mysql SQL語句積累參考

學問君 人氣:1.94W

--重命名錶

mysql SQL語句積累參考

rename table t_softwareport to software_port;

--建立外鍵

alter table software_port add constraint fk_software_port_softwareprocessid foreign key (softwareprocessid) references software_process (id) on restrict on restrict;

--刪除列

alter table software_type drop column upid, drop column orderid;

--修改列名

alter table software_process change software_id softwareid int(11) not null;

--更改列編碼

alter table cms_contentbody modify column offical_site_name var30) character set utf8 collate utf8_unicode_ci not null;

--增加列

alter table cms_flash add name var30) not null unique;

TAGS:SQL 語句 mysql