create view[or replace] 创建一个视图,如果已经处在一个同名,会报错。除非你使用or repalce 需要具备老视图上的drop权限。
[algorithm={merge|temptable|undefined}]
[Definer=definer_name]
[sql security={definer|invoker}]
view view_name[(col_list) as select_stmt]
[with [cascaded|local] check option] 可更新视图。
create view view1 as select t1.student_id,t1.name,t2.event_id from sampdb1.student t1 inner join sampdb1.score t2 where t1.student_id=t2.student_id;
create [definer = definer_name]
tigger trigger_name trigger_time trigger_event
on tbl_name
for each row trigger_stmt;
需要有tigger 权限。
trigger_time 有两个值befor after .
trigger_event: insert update delete.
trigger_stmt :是由SQL语句构成。
create index[unique|fulltext|spatial]
index_name[index_type]
on tbl_name
index_type:using{btree|hash|rtree}
create [definer = definer_name] event [if not exsits] event_name
on schedule schedule
[con completion [not] presever]
[enable|disable|dissable on slave]
[comment 'str']
[do event_stmt]
MySIAM键缓存,