--
create table pass(id int primary key auto_increment,name varchar(15),score int );
create table unpass(id int primary key auto_increment,name varchar(15),score int);
-- 使用存储过程来
create procedure myif(in name varchar(15),in score int)
begin
if score >=60 then
insert into pass(name,score) values(name,score);
else
insert into unpass(name,score) values(name,score);
end if;
end;
-- 调用,并查看结果
call myif("lilei",61);
call myif("hanmeimei",95);
select * from pass;
select * from unpass;
call myif("tuhao",59);
select * from unpass;