freepeople性欧美熟妇, 色戒完整版无删减158分钟hd, 无码精品国产vα在线观看DVD, 丰满少妇伦精品无码专区在线观看,艾栗栗与纹身男宾馆3p50分钟,国产AV片在线观看,黑人与美女高潮,18岁女RAPPERDISSSUBS,国产手机在机看影片

正文內(nèi)容

計(jì)算機(jī)二級mysql知識點(diǎn)總結(jié)超全-文庫吧資料

2024-10-31 18:10本頁面
  

【正文】 起作用 。 repair table 語句 : 修復(fù) 。 只對 innodb、 myisam、 archive 和 csv 表起作用 。 若 cardinality值比數(shù)據(jù)的實(shí)散列程度小很多,索引將失效, 此時使用 analyze table語句修復(fù) cardinality值提高查詢效率 * Mysqlanalyze table 。 更新完整性約束: alter table 語句(可以獨(dú)立的刪除完整性約束,而不會刪除表本身) 表維護(hù)語句 analyze table 語句 Mysqlshow index from 。 只能基于表的完整性約束命名,而無法給基于列的完整性約束命名。 Mysqlcreate table grades_new ( student_id int not null auto_increment, student_score int not null, student_time int not null, student_id int not null, check(student_id in(select student_id from students)), *表 grades_new 的 student_id 列所有值 來源于表 students 的 student_id列 primary key(grade_id), )。 Not null。 定義外鍵應(yīng)遵守:父表必須已經(jīng)存在于數(shù)據(jù)庫,或者是當(dāng)前正在創(chuàng)建的表;必須為父表定義主鍵;主鍵不能包含空值,但允許在外鍵中出現(xiàn)空值;在父表的表名后面指定列名或列名的組合;外鍵中的數(shù)目(數(shù)目類型)必須和父表的主鍵中的列的數(shù)目(數(shù)據(jù)類型)相同; 用戶定義完整性:某一具體應(yīng)用所涉及的數(shù)據(jù)必須滿足的要求。 Reference 表名 [ 列名 [(length)]][asc|desc][match full|match partial|match simple]on[delete|update][restrict|cascade|set null|no action] Mysqluse mytest。不允許引用不存在的實(shí)體 , 目的是保證數(shù)據(jù)的一致性 。 參照完整性 :表間主鍵外 鍵的關(guān)系。值必須唯一,且不能為 null。 Mysqlcreate table students_new ( student_id int not null auto_increment primary key, *以列的完整性約束方式定義主鍵 * student_name char(50) not null, student_sex char(1) not null default o, student_age int not null, student_major char(50) not null, student_contact char(50) null )。復(fù)合主鍵不能包含不必要的多余列。可以是表中一列或多列的組合?;娟P(guān)系的所有主關(guān)鍵字對應(yīng)的主屬性都不能取空值。 Mysqlcreate view as select * from where student_major=’物理專業(yè) ’。 查詢視圖數(shù)據(jù) Mysqlselect student_name,student_major from where student_name=’將子涵 ’。 使用 delete 語句通過視圖刪除基礎(chǔ)表數(shù)據(jù) : 對于依賴多個基礎(chǔ)表的視圖 , 不能使用 delete 語句 。 使用 update 語句通過視圖修改基礎(chǔ)表數(shù)據(jù) : 視圖依賴多個基礎(chǔ)表 , 則一次視圖修改只能改變一個基礎(chǔ)表中數(shù)據(jù) 。 使用 insert 語句通過視圖向基礎(chǔ)表插入數(shù)據(jù) : 當(dāng)視圖依賴多個基礎(chǔ)表時不能向該視圖插入數(shù)據(jù)。 *修改視圖時 , 檢查插入的數(shù)據(jù)是否符合 where 設(shè)置 的條件 * 刪除視圖 : drop view視圖名 1[,視圖名 2]… 修改和查看視圖定義 修改視圖定義: alter view視圖名 asselect 語句 查看視圖定義: show create view視圖名 更新視圖數(shù)據(jù): 通過插入 、 修改和刪除操作更新視圖中的 數(shù)據(jù) , 實(shí)質(zhì)上是更新所引用的基礎(chǔ)表的數(shù)據(jù) 。 優(yōu)點(diǎn) : 定制用戶數(shù)據(jù) , 聚焦特定 數(shù)據(jù) ; 簡化數(shù)據(jù)操作 ; 提高基表數(shù)據(jù)的安全性 ; 共享所需數(shù)據(jù) ; 更改數(shù)據(jù)格式 ( 每個用戶不必都定義和存儲自己所需的數(shù)據(jù) , 可以共享數(shù)據(jù) , 同樣的數(shù)據(jù)只需存儲一次 ); 重寫 sql 語句 。視圖包含一系列帶有名稱的列和行數(shù)據(jù),但視圖并不是數(shù)據(jù)庫真實(shí)存儲的數(shù)據(jù)集。 *刪除數(shù)據(jù)庫 mytest的表 students 的索引 index_students* 索引進(jìn)階 弊端 : 創(chuàng)建和維護(hù)索引耗時 ; 占數(shù)據(jù)和物理空間 ; 不適合創(chuàng)建索引 : 很少使用或參考的列 ; 很少數(shù)據(jù)值的列 ; text,image 和 bit 數(shù)據(jù)類型 ; 修改性能遠(yuǎn)遠(yuǎn)大于檢索性能 . 第 7 章 視圖 :視圖的建立和刪除只影響視圖本身,不影響對應(yīng)的基礎(chǔ)表。 drop index索引名 on表名 Mysqldrop index index_place on 。 alter table ( 1) add index[索引名 ][索引類型 ](列名 ,….) ( 2) add primary key[索引類型 ](列名 ,….) ( 3) add unique[index|key][索引名 ] [索引類型 ](列名 ,….) ( 4) alter foreign key][索引名 ] (列名 ,….) 查看索引 : show index from 表名 [from數(shù)據(jù)庫名 ] Mysqlshow index from course from mytest。 create table 時添加 ( 1) constraint primary key[索引類型 ](列名 ,…) 創(chuàng)建表的同時創(chuàng)建表中主鍵 ( 2) key|index [索引名 ] [索引類型 ](列名 ,…) 創(chuàng)建表的同時創(chuàng)建表中索引 ( 3) unique[ key|index] [索引名 ] [索引類型 ](列名 ,…) 創(chuàng)建表的同時創(chuàng)建表中唯一性索引 ( 4) foreign key 索引名 列名 創(chuàng)建表的同時創(chuàng)建表中外鍵 Mysqluse mytest。 Mysqlcreate index index_stud *根據(jù) student_name 和 student_id創(chuàng)建復(fù)合索引 index_stud。 * mytest表 students 中 , 根據(jù)學(xué)生姓名前三個字符 , 默認(rèn)類型升序 。Blob 或 text 類型的列必須使用前綴索引。 創(chuàng)建索引 create index 語句 :不能創(chuàng)建主鍵 Create索引名 on表名 (列名 [長度 ][asc|desc]) 一個表可以創(chuàng)建多個索引 , 但每個索引在該表中的名稱是惟一的 。 ( 4) 空間索引 ( 5)全文索引:只能在 varchar 或 text 類型的列上創(chuàng)建,且只能在 myisam 表中創(chuàng)建。 ( 3)主鍵:一種唯一性 索引 。 邏輯分類 ( 1)普通索引:最基本索引類型,唯一任務(wù)是加快對數(shù)據(jù)的訪問速度。 ○ 3 根節(jié)點(diǎn) :一個 btree 索引只有一個根節(jié)點(diǎn)。 葉子節(jié)點(diǎn)之間彼此相連 , 一個葉子節(jié)點(diǎn)有一個指向下一個葉子節(jié)點(diǎn)的指針 。 物理分類 ( 1) B樹索引( btree):大部分索引采用的存儲方式 ;查詢必須從索引的最左邊列開始,不能跳過某一索引列;存儲引擎不能使用索引中范圍內(nèi)條件右邊的列。( 2)索引訪問:遍歷 索引 直接訪問。 第 6 章 索引 簡介 索引 :根據(jù)表中 一列或多列 按照一定順序建立的列值與記錄行之間的對應(yīng)關(guān)系。 Limit{[標(biāo)志位置 ]行數(shù) |行數(shù) offset標(biāo)志位置 } mysqlselect student_id,student_name from limit 4,3 *從第 5 個學(xué)生開始的 3 個 學(xué)生 * mysqlselect student_id,student_name from order by student_id limit 3 offset 4。 order by{列名 |表達(dá)式 |位置 }[asc|desc] mysqlselect student_name,student_age from order by student_age desc。 mysqlselect student_major,count(*) as ‘總?cè)藬?shù) ’ from group by student_major having count( *) 2。 mysqlselect student_major, avg(student_age) as ‘平均年齡 ’ from students group by student_major。 group by 子句 與分組數(shù)據(jù) : group by{列名 |表達(dá)式 |位置 }[asc|desc]。 判定空值: 表達(dá)式 is [not] null mysqlselect student_name ,student_contact from where student_contact is null。 ( 2) in:盡管可以用于范圍判定,但主要作用是表達(dá)式子查詢。 ( 3) 范圍匹配 : [] mysqlselect student_name ,student_age from where student_age regexp’[45+’。 ○ 3 正則表達(dá)式 :查找專業(yè)含‘物’的行 mysqlselect student_name,student_age,student_major from where student_major regexp’物 ’。 表達(dá)式 1[not][regexp|rlike]表達(dá)式 2 ( 1)基本字符匹配 ○ 1 直接匹配 : 只查找專業(yè)是 ‘ 物 ’ 的行 mysqlselect student_name,student_age,student_major from where student_major like’物 ’。 mysqlselect student_id,student_name from where student_name like’李 _’。 mysqlselect student_id,student_name from where student_name like’李 %’。 表達(dá)式 1[not]like 表達(dá)式 2 ( 1)百分號( %):可表示任何字符串,且該字符串可出現(xiàn)任意次數(shù)。 mysqlselect * from where student_sex=’1’。 where查詢條件 {判定運(yùn)算 1, 判定運(yùn)算 2…} 比較運(yùn)算 。左外連接、右外連接。 需要指定兩個不同的別名,所有查詢列的引用須用表別名限定 ( 4)自然連接:只有在連接的列在兩張表中的名稱都相同時才會有用,否則返回笛卡兒積。 select列名 1,列名 2…from表名 1[inner] join表名 2[on 子句 ] mysqlselect * from inner join on 。 ( 2)內(nèi)連接:系統(tǒng)默認(rèn)的表連接。 from 子句 與連接表 ( 1) 交叉連接 ( 笛卡兒積 ): 結(jié)果集合中數(shù)據(jù)行數(shù)等于第一個表中符合條件的數(shù)據(jù)行數(shù)乘以第二個表中數(shù)據(jù)行數(shù) 。 聚合函數(shù) : mysql 系統(tǒng)內(nèi)置函數(shù) 。 計(jì)算列值 mysqlselect student_name,student_id,student_id+100 from students。 列別名不允許出現(xiàn)在 where 子句中 。 *列名的指定可采用直接給出列名的方式 , 或完全限定列名方式 * Mysqlselect*from 。 update表 1,表 2,…set 列名 1=值 1[,列名 2=值 2…+*where子句 ] mysqlupdate tbl1,tbl2 set =’李明 ’,tbl2=’王偉 ’ where =。 where student_name=’李芳 ’。 修改表數(shù)據(jù): update語句 ○ 1 修改單個表 。 mysqldelete tbl1,tbl2 from tbl1,tbl2,tbl3 where = and =。 ○2 同時 刪除多個表中的數(shù)據(jù)行 。 Limit 被刪除行的最大值 。 刪除表數(shù)據(jù) delete 語句 ○ 1 刪除單個表中的數(shù)據(jù) 。 replace 語句: 替換 主鍵重復(fù)的行數(shù)據(jù) 。 可以指定插入行中沒列的值 , 也可以指
點(diǎn)擊復(fù)制文檔內(nèi)容
公司管理相關(guān)推薦
文庫吧 www.dybbs8.com
備案圖鄂ICP備17016276號-1