觸發器的應用:在一個表中刪除或新增一條數據時,另一個表也需要刪除或者新增一條數據
觸發器新增:
insert into t_user_acdamic (user_name,user_identity) values (new.user_name,new.user_identity)
1所表示的是你所要新增數據的另一張表的表名,2表示你所要新增數據的數據字段,3表示你新增的數據字段的值
觸發器刪除:
delete from t_user_exam where user_name = old.user_name;
1表示你所要刪除數據的另一張表的表名,2表示你具體刪除的那條數據,判斷兩個表所刪除的數據時相同的