




版權(quán)說明:本文檔由用戶提供并上傳,收益歸屬內(nèi)容提供方,若內(nèi)容存在侵權(quán),請(qǐng)進(jìn)行舉報(bào)或認(rèn)領(lǐng)
文檔簡介
高級(jí)特性字符集character
setcollationselect
*
from
information_schema.character_setsselect*
from
collations
where
character_set_name
='utf8';variablescharacter_set_system
=
utf8character_set_servercharacter_set_databasecharacter_set_connectioncharacter_set_resultscharacter_set_clientvariablescollation_connectioncollation_databasecollation_server字符串的編碼stored
program存儲(chǔ)過程(stored
procedure)函數(shù)(function)觸發(fā)器(trigger)事件調(diào)度器(event)show
create
…stored
proceduredrop
procedure
if
exists
pro_create_tab;delimiter
//create
procedure
pro_create_tab()BEGINset
@i=0;while
@i<=99
doset
@sqlstr=concat('CREATE
TABLEuser_',lpad(@i,2,0),'(id
bigint
NOT
NULL
AUTO_INCREMENT,user
varchar(20),gender
char(1),PRIMARY
KEY
(ID))');prepare
stmt
from
@sqlstr;execute
stmt;set
@i=@i+1;end
while;END
//delimiter
;call
pro_create_tab();functiondelimiter
//drop
function
if
exists
bphit;create
function
bphit
()
returns
floatDETERMINISTICbeginselect
variable_value
into
@read
from
information_schema.global_status
where
variable_name
=
'iselect
variable_value
into
@req_read
from
information_schema.global_status
where
variable_namreturn
(@req_read-@read)/@req_read;end//delimiter
;triggerbefore/afterinsert/update/delete5.7delimiter
//drop
trigger
if
exists
trg_after_insert_user
//create
trigger
trg_after_insert_user
after
insert
on
user_00for
each
rowbegininsert
into
counter
(gender,
c)
values
(new.gender,
1)
onduplicate
key
update
c=c+1;end//delimiter
;delimiter
//drop
triggerifexists
trg_after_insert_user_all
//create
trigger
trg_after_insert_user_all
after
insert
on
userfor
each
rowbeginset
@prefix
=
new.id
%
100;case
@prefixwhen
0
then
insert
into
user_00
values
(new.id,
new.user,
new.gender);when
1
then
insert
into
user_01
values
(new.id,
new.user,
new.gender);when
2
then
insert
into
user_02
values
(new.id,
new.user,
new.gender);elsebeginend;end
case;end//delimiter
;Insert
into
user_88
select
*
from
user
where
id
%
100=
88;online
schema
change?eventdelimiter//drop
event
e_store_ts
//create
event
e_store_tson
scheduleevery
10
seconddobegininsert
into
ts
values
(now());insert
into
ts
values
(now());end//delimiter
;delimiter//drop
event
e_store_at
//create
event
e_store_aton
schedule
at
‘2016-02-20
21:07:00’dobegininsert
into
ts
values
(now());insert
into
ts
values
(now());end//delimiter
;視圖create
view
v
as
select
xxxalgorithm
=
merge|temptable|undefinedwith
check
optionview
vs.
temporary
tablegrant
for
rows
and
column全文索引InnoDB/MyISAMchar/varchar/textalter
table
xxx
add
fulltext
index
(col)select
*
from
xxx
where
match(col)
against
(key)in
natural
language
modein
natural
language
mode
with
query
expansionin
boolean
modewith
query
expansionSelect
xx
from
xx
where
match(content)
against(‘database*’
in
Boolean
mode)partitionrange/list/columns/hash/key/primary
key5.6
報(bào)錯(cuò)信息globalrangecreate
table
test_p(id
int,dt
datetime
not
null)partition
by
range
(to_days(dt))(partition
p0
values
less
than
(to_days('2016-01-01')),partition
p1
values
less
than
(to_days('2016-02-01')),partition
p2
values
less
than
(to_days('2016-03-01')),partition
p3
values
less
than
maxvalue);insert
into
test_p
select
rand()*100000000,
'2016-1-1'+interval
rand()*200
day
from
test_p;auditinit-connect='insert
into
audit.login_log(ConnectionID,ConnUserName,PrivMatchName,LoginTime)values(connection_id(),user(),
溫馨提示
- 1. 本站所有資源如無特殊說明,都需要本地電腦安裝OFFICE2007和PDF閱讀器。圖紙軟件為CAD,CAXA,PROE,UG,SolidWorks等.壓縮文件請(qǐng)下載最新的WinRAR軟件解壓。
- 2. 本站的文檔不包含任何第三方提供的附件圖紙等,如果需要附件,請(qǐng)聯(lián)系上傳者。文件的所有權(quán)益歸上傳用戶所有。
- 3. 本站RAR壓縮包中若帶圖紙,網(wǎng)頁內(nèi)容里面會(huì)有圖紙預(yù)覽,若沒有圖紙預(yù)覽就沒有圖紙。
- 4. 未經(jīng)權(quán)益所有人同意不得將文件中的內(nèi)容挪作商業(yè)或盈利用途。
- 5. 人人文庫網(wǎng)僅提供信息存儲(chǔ)空間,僅對(duì)用戶上傳內(nèi)容的表現(xiàn)方式做保護(hù)處理,對(duì)用戶上傳分享的文檔內(nèi)容本身不做任何修改或編輯,并不能對(duì)任何下載內(nèi)容負(fù)責(zé)。
- 6. 下載文件中如有侵權(quán)或不適當(dāng)內(nèi)容,請(qǐng)與我們聯(lián)系,我們立即糾正。
- 7. 本站不保證下載資源的準(zhǔn)確性、安全性和完整性, 同時(shí)也不承擔(dān)用戶因使用這些下載資源對(duì)自己和他人造成任何形式的傷害或損失。
最新文檔
- 建筑土方施工協(xié)議書
- 民事事故傷害協(xié)議書
- 結(jié)婚協(xié)議書文案復(fù)制
- 生鮮商品承包協(xié)議書
- 離婚贈(zèng)與協(xié)議書范本
- 私人投資轉(zhuǎn)讓協(xié)議書
- 經(jīng)費(fèi)捐贈(zèng)協(xié)議書模板
- 門牙修復(fù)和解協(xié)議書
- 租賃老宅協(xié)議書范本
- 維修物品運(yùn)輸協(xié)議書
- 幼兒園環(huán)境衛(wèi)生檢查通報(bào)制度
- 普惠托育服務(wù)體系建設(shè)方案
- 2025年新高考?xì)v史預(yù)測(cè)模擬試卷浙江卷(含答案解析)
- 1.第3屆中國播音主持“金聲獎(jiǎng)”優(yōu)廣播電視播音員主持人推表
- 2025年管道工(高級(jí))職業(yè)技能鑒定參考試題(附答案)
- 成品油柴油汽油運(yùn)輸合同5篇
- T-HHES 010-2024 生產(chǎn)建設(shè)項(xiàng)目水土流失危害評(píng)估編制導(dǎo)則
- 自考心理健康教育05624心理治療(一)打印版
- 《妊娠期合理用藥》課件
- 民兵反恐維穩(wěn)培訓(xùn)
- 測(cè)量不確定度評(píng)定和表示培訓(xùn)
評(píng)論
0/150
提交評(píng)論