mysql SQL語(yǔ)句積累
更新時(shí)間:2011年09月15日 00:02:44 作者:
mysql SQL語(yǔ)句積累,學(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-09MySQL創(chuàng)建索引/判斷索引是否生效的問(wèn)題
這篇文章主要介紹了MySQL創(chuàng)建索引/判斷索引是否生效的問(wèn)題,具有很好的參考價(jià)值,希望對(duì)大家有所幫助,如有錯(cuò)誤或未考慮完全的地方,望不吝賜教2023-08-08deepin 2014系統(tǒng)下安裝mysql數(shù)據(jù)庫(kù)的方法步驟
這篇文章主要給大家介紹了在deepin 2014系統(tǒng)下安裝mysql數(shù)據(jù)庫(kù)的方法步驟,文中通過(guò)圖文介紹的非常詳細(xì),相信對(duì)大家具有一定的參考價(jià)值,需要的朋友們下面來(lái)一起看看吧。2017-04-04Mysql通過(guò)ibd文件恢復(fù)數(shù)據(jù)的詳細(xì)步驟
mysql在使用的過(guò)程中,難免遇到數(shù)據(jù)庫(kù)表誤操作,下面這篇文章主要給大家介紹了關(guān)于Mysql通過(guò)ibd文件恢復(fù)數(shù)據(jù)的詳細(xì)步驟,文中通過(guò)實(shí)例代碼介紹的非常詳細(xì),需要的朋友可以參考下2022-06-06淺談MySQL數(shù)據(jù)庫(kù)的備份與恢復(fù)
MYSQL數(shù)據(jù)庫(kù)的備份、恢復(fù)等是每一位信息管理人員應(yīng)必備的能力,因此掌握MYSQL數(shù)據(jù)庫(kù)管理的技巧會(huì)使您的工作事半功倍,這里我們來(lái)簡(jiǎn)單總結(jié)下。2017-01-01MAC下MYSQL5.7.17連接不上的問(wèn)題及解決辦法
MAC下MYSQL5.7.17無(wú)法連接的問(wèn)題,下載安裝完SQLBench_community 6.3.9后新建MYSQL CONNECTIONS根本連接不上,提示為密碼錯(cuò),什么原因如何解決呢?今天小編給大家解答下2017-02-02解決mysql不能插入中文Incorrect string value
首先我的配置文件的設(shè)置的默認(rèn)字符集是utf8即2009-05-05