mysql SQL語句積累
更新時(shí)間:2011年09月15日 00:02:44 作者:
mysql SQL語句積累,學(xué)習(xí)mysql的朋友可以參考下。
--重命名表
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;
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;
相關(guān)文章
MySQL 中 datetime 和 timestamp 的區(qū)別與選擇
MySQL 中常用的兩種時(shí)間儲(chǔ)存類型分別是datetime和 timestamp。如何在它們之間選擇是建表時(shí)必要的考慮。下面就談?wù)勊麄兊膮^(qū)別和怎么選擇,需要的朋友可以參考一下2021-09-09deepin 2014系統(tǒng)下安裝mysql數(shù)據(jù)庫(kù)的方法步驟
這篇文章主要給大家介紹了在deepin 2014系統(tǒng)下安裝mysql數(shù)據(jù)庫(kù)的方法步驟,文中通過圖文介紹的非常詳細(xì),相信對(duì)大家具有一定的參考價(jià)值,需要的朋友們下面來一起看看吧。2017-04-04Mysql通過ibd文件恢復(fù)數(shù)據(jù)的詳細(xì)步驟
mysql在使用的過程中,難免遇到數(shù)據(jù)庫(kù)表誤操作,下面這篇文章主要給大家介紹了關(guān)于Mysql通過ibd文件恢復(fù)數(shù)據(jù)的詳細(xì)步驟,文中通過實(shí)例代碼介紹的非常詳細(xì),需要的朋友可以參考下2022-06-06淺談MySQL數(shù)據(jù)庫(kù)的備份與恢復(fù)
MYSQL數(shù)據(jù)庫(kù)的備份、恢復(fù)等是每一位信息管理人員應(yīng)必備的能力,因此掌握MYSQL數(shù)據(jù)庫(kù)管理的技巧會(huì)使您的工作事半功倍,這里我們來簡(jiǎn)單總結(jié)下。2017-01-01解決mysql不能插入中文Incorrect string value
首先我的配置文件的設(shè)置的默認(rèn)字符集是utf8即2009-05-05