当前位置:数据库 > MySQL >>

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 delete restrict on update 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 varchar(30) character set utf8 collate utf8_unicode_ci not null;

--增加列

alter table cms_flash add name varchar(30) not null unique;

上一个:MySQL安装详解图文版(V5.5 For Windows)
下一个:Mysql Data目录和 Binlog 目录 搬迁的方法

Oracle
MySQL
Access
SQLServer
DB2
Excel
SQLite
SYBASE
Postgres
如果你遇到数据库难题:
请访问www.zzzyk.com 试试
CopyRight © 2012 站长网 编程知识问答 www.zzzyk.com All Rights Reserved
部份技术文章来自网络,