偷偷摘套内射激情视频,久久精品99国产国产精,中文字幕无线乱码人妻,中文在线中文a,性爽19p

MySQL 常用命令整理匯總

數(shù)據(jù)庫(kù) MySQL
此文章主要介紹的是MySQL 常用命令以及對(duì)MySQL 常用命令的整理,下面就是文章的具體內(nèi)容描述,望你會(huì)有所收獲。

以下的文章主要介紹的是MySQL 常用命令以及對(duì)MySQL 常用命令的整理 ,我們大家都知道MySQL 常用命令在實(shí)際應(yīng)用中應(yīng)用的比例是比較多的,今天我們就像大家詳細(xì)介紹一下MySQL 常用命令與其整理。

是否存在

  1. MySQL> use imss;  
  2. MySQL> select if(exists(select * from information_schema.columns where table_name = 
    'imss_righttemplate' and column_name='id_righttemplate'),'yes','no') as cz ; 

 

MySQL 常用命令整理 :主鍵

  1. MySQL> alter table tabelname add new_field_id int(5) unsigned default 0 not null auto_increment ,add primary key (new_field_id); 

增加一個(gè)新列

  1. MySQL> alter table t2 add d timestamp;  
  2. MySQL> alter table infos add ex tinyint not null default '0'; 

刪除列

  1. MySQL> alter table t2 drop column c; 

重命名列

 

  1. MySQL> alter table t1 change a b integer; 

改變列的類(lèi)型

 

  1. MySQL> alter table t1 change b b bigint not null;  
  2. MySQL>alter table infos change list list tinyint not null default '0'; 

MySQL 常用命令整理 :重命名表

  1. MySQL> alter table t1 rename t2; 

加索引

  1. MySQL> alter table tablename change depno depno int(5) not null;  
  2. MySQL> alter table tablename add index 索引名 (字段名1[,字段名2 …]);  
  3. MySQL> alter table tablename add index emp_name (name); 

加主關(guān)鍵字的索引

  1. MySQL> alter table tablename add primary key(id); 

加***限制條件的索引

  1. MySQL> alter table tablename add unique emp_name2(cardnumber); 

刪除某個(gè)索引

 

  1. MySQL>alter table tablename drop index emp_name; 

增加字段

  1. MySQL> ALTER TABLE table_name ADD field_name field_type; 

修改原字段名稱(chēng)及類(lèi)型

  1. MySQL> ALTER TABLE table_name CHANGE old_field_name new_field_name field_type; 

刪除字段

  1. MySQL> ALTER TABLE table_name DROP field_name; 

以上的相關(guān)內(nèi)容就是對(duì)MySQL 常用命令整理的介紹,望你能有所收獲。

【編輯推薦】

  1. 支持MySQL數(shù)據(jù)庫(kù),SPL升級(jí)到3.2
  2. MySQL添加授權(quán)的用戶(hù)命令實(shí)際操作
  3. MySQL導(dǎo)入與導(dǎo)出.sql文件實(shí)操
  4. asp.net連接MySQL的正確操作流程
  5. MySQL數(shù)據(jù)庫(kù)備份基礎(chǔ)知識(shí)匯總
責(zé)任編輯:佚名 來(lái)源: 博客園
相關(guān)推薦

2010-05-28 18:28:51

MySQL常用命令

2010-03-29 10:16:39

CentOS常用命令

2010-04-01 18:10:32

CentOS常用命令

2013-04-28 14:03:26

Android開(kāi)發(fā)Android常用命令

2010-04-01 17:19:04

CentOS常用命令

2010-05-27 13:12:10

MySQL 常用命令

2023-10-31 16:17:42

2025-09-11 08:00:00

MySQL運(yùn)維數(shù)據(jù)庫(kù)

2010-04-06 15:04:55

CentOS常用命令

2010-03-24 17:44:58

CentOS常用命令

2025-07-17 12:26:46

LinuxKVM虛擬化

2025-08-06 06:40:00

MyBatisSQL開(kāi)發(fā)

2018-05-29 15:53:01

LinuxGit常用命令

2010-04-01 18:23:02

CentOS常用命令

2017-03-01 17:27:32

LinuxShell命令

2015-07-22 17:32:22

mysql常用命令

2025-04-14 08:00:00

Docker命令運(yùn)維

2014-07-25 10:55:36

Linux命令

2011-03-16 10:07:00

2011-01-19 17:00:09

Postfix常用命令
點(diǎn)贊
收藏

51CTO技術(shù)棧公眾號(hào)