mysql 5.1以上版本创建触发器(1)_insert
DROP
TRIGGER
IF EXISTS inserUserInfo;
--红色为数据库名称,绿色为表名称--
create trigger inserUserInfo after insert on sql.student
for each row
begin
insert into sql.user (name,pwd) values(NEW.姓名,substring(NEW.姓名,7,8));
end
DROP
TRIGGER
IF EXISTS inserUserInfo;
--红色为数据库名称,绿色为表名称--
create trigger inserUserInfo after insert on sql.student
for each row
begin
insert into sql.user (name,pwd) values(NEW.姓名,substring(NEW.姓名,7,8));
end